summaryrefslogtreecommitdiffstats
path: root/test/PCurlTest.php
diff options
context:
space:
mode:
authorpurplecode <niespammnie@gmail.com>2014-12-24 12:22:27 +0100
committerpurplecode <niespammnie@gmail.com>2014-12-24 12:22:27 +0100
commit5b74984770c4228808138231c9580d22f7282475 (patch)
tree76594a6e1ace53e3f67bb400c9311655a1d6b4a6 /test/PCurlTest.php
parentffd2008900b34c003e99e09d710586e0435f5af6 (diff)
downloadphp.curl-5b74984770c4228808138231c9580d22f7282475.zip
php.curl-5b74984770c4228808138231c9580d22f7282475.tar.gz
php.curl-5b74984770c4228808138231c9580d22f7282475.tar.bz2
formatting
Diffstat (limited to 'test/PCurlTest.php')
-rw-r--r--test/PCurlTest.php60
1 files changed, 29 insertions, 31 deletions
diff --git a/test/PCurlTest.php b/test/PCurlTest.php
index d05f72d..a3c0724 100644
--- a/test/PCurlTest.php
+++ b/test/PCurlTest.php
@@ -6,43 +6,43 @@ 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');
+ public function testShouldGetGooglePageViaHttp() {
+ // given
+ $cut = new PCurl('http://www.google.pl');
- // when
- $response = $cut->get('/');
+ // when
+ $response = $cut->get('/');
- // then
- $this->assertSelectRegExp('title', '/Google/', 1, $response->getBody());
- $this->assertEquals(200, $response->getHttpCode());
+ // then
+ $this->assertSelectRegExp('title', '/Google/', 1, $response->getBody());
+ $this->assertEquals(200, $response->getHttpCode());
}
- public function testShouldGetGooglePageAndCheckHttpsCertificate() {
- // given
- $cut = new PCurl('https://www.google.pl');
- $cut->useSSLCertificate($this->getCACertBundlePath());
+ public function testShouldGetGooglePageAndCheckHttpsCertificate() {
+ // given
+ $cut = new PCurl('https://www.google.pl');
+ $cut->useSSLCertificate($this->getCACertBundlePath());
- // when
- $response = $cut->get('/');
+ // when
+ $response = $cut->get('/');
- // then
- $this->assertSelectRegExp('title', '/Google/', 1, $response->getBody());
- }
+ // then
+ $this->assertSelectRegExp('title', '/Google/', 1, $response->getBody());
+ }
- public function testShouldGetGooglePageAndThrowExceptionOnMissingCertificate() {
- // given
- $cut = new PCurl('https://www.google.com');
+ 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('/');
+ // when
+ $response = $cut->get('/');
}
public function testShouldSetProperResponseCodeOnBadRequest() {
@@ -51,10 +51,9 @@ class PCurlTest extends PHPUnit_Framework_TestCase {
// then
//$this->setExpectedException('PurpleCode\PCurl\PCurlException');
-
// when
$response = $cut->get('/');
-
+
// then
$this->assertEquals(404, $response->getHttpCode());
}
@@ -70,5 +69,4 @@ class PCurlTest extends PHPUnit_Framework_TestCase {
$response = $cut->get('/')->assertSuccess();
}
-
-} \ No newline at end of file
+}