summaryrefslogtreecommitdiffstats
path: root/test/PCurlTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'test/PCurlTest.php')
-rw-r--r--test/PCurlTest.php25
1 files changed, 12 insertions, 13 deletions
diff --git a/test/PCurlTest.php b/test/PCurlTest.php
index 841603a..566ad0f 100644
--- a/test/PCurlTest.php
+++ b/test/PCurlTest.php
@@ -6,39 +6,38 @@ use PurpleCode\PCurl\PCurl;
class PCurlTest extends PHPUnit_Framework_TestCase {
- private function getCACertBundlePath() {
- return __DIR__.'\ca-cert.crt';
- }
+ private function getCACertBundlePath() {
+ return __DIR__.'\ca-cert.crt';
+ }
public function testShouldGetGooglePageViaHttp() {
// given
- $cut = new PCurl('http://www.google.pl');
+ $cut = new PCurl('http://www.google.pl');
// when
$response = $cut->get('/');
-
// then
- $this->assertSelectRegExp('title', '/Google/', 1, $response);
+ $this->assertSelectRegExp('title', '/Google/', 1, $response->getBody());
}
- public function testShouldGetGooglePageAndCheckHttpsCertificate() {
+ public function testShouldGetGooglePageAndCheckHttpsCertificate() {
// given
- $cut = new PCurl('https://www.google.pl');
- $cut->useSSLCertificate($this->getCACertBundlePath());
+ $cut = new PCurl('https://www.google.pl');
+ $cut->useSSLCertificate($this->getCACertBundlePath());
// when
$response = $cut->get('/');
// then
- $this->assertSelectRegExp('title', '/Google/', 1, $response);
- }
+ $this->assertSelectRegExp('title', '/Google/', 1, $response->getBody());
+ }
public function testShouldGetGooglePageAndThrowExceptionOnMissingCertificate() {
// given
$cut = new PCurl('https://www.google.com');
- // then
- $this->setExpectedException('PurpleCode\PCurl\PCurlException');
+ // then
+ $this->setExpectedException('PurpleCode\PCurl\PCurlException');
// when
$response = $cut->get('/');