summaryrefslogtreecommitdiffstats
path: root/test/PJsonCurlTest.php
diff options
context:
space:
mode:
authorpurplecode <niespammnie@gmail.com>2014-12-24 12:20:42 +0100
committerpurplecode <niespammnie@gmail.com>2014-12-24 12:20:42 +0100
commitffd2008900b34c003e99e09d710586e0435f5af6 (patch)
tree56be804884177a9e6696d566390eb9c2c6bfb5e7 /test/PJsonCurlTest.php
parenta3b4c26df66605c76c5893dc1aee2d578b474aed (diff)
downloadphp.curl-ffd2008900b34c003e99e09d710586e0435f5af6.zip
php.curl-ffd2008900b34c003e99e09d710586e0435f5af6.tar.gz
php.curl-ffd2008900b34c003e99e09d710586e0435f5af6.tar.bz2
json, object response changes + test fixes
Diffstat (limited to 'test/PJsonCurlTest.php')
-rw-r--r--test/PJsonCurlTest.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/PJsonCurlTest.php b/test/PJsonCurlTest.php
index 8aec5b8..80f765d 100644
--- a/test/PJsonCurlTest.php
+++ b/test/PJsonCurlTest.php
@@ -2,33 +2,33 @@
require_once (dirname(__FILE__) . '/../src/PurpleCode/PCurl/PCurlResponse.php');
-require_once (dirname(__FILE__) . '/../src/PurpleCode/PCurl/PCurlJsonResponse.php');
+require_once (dirname(__FILE__) . '/../src/PurpleCode/PCurl/Json/PJsonCurlResponse.php');
require_once (dirname(__FILE__) . '/../src/PurpleCode/PCurl/PCurl.php');
-require_once (dirname(__FILE__) . '/../src/PurpleCode/PCurl/PJsonCurl.php');
+require_once (dirname(__FILE__) . '/../src/PurpleCode/PCurl/Json/PJsonCurl.php');
-use PurpleCode\PCurl\PJsonCurl;
+use PurpleCode\PCurl\Json\PJsonCurl;
-class PCurlTest extends PHPUnit_Framework_TestCase {
+class PJsonCurlTest extends PHPUnit_Framework_TestCase {
private function getCACertBundlePath() {
return __DIR__.'\ca-cert.crt';
}
public function testShouldGetJsonFileAndParse() {
- // given
- $cut = new PJsonCurl('file://test.json');
+ // given
+ $cut = new PJsonCurl('file:///'.__DIR__.'/test.json');
// when
$response = $cut->get('');
// then
- $this->assertEquals(2, $response->getBody()->a->b);
- $this->assertEquals("a", $response->getBody()->a->c);
+ $this->assertEquals(2, $response->getJson()->a->b);
+ $this->assertEquals("a", $response->getJson()->a->c);
}
public function testShouldFailParseWrongFile() {
// given
- $cut = new PJsonCurl('file://testInvaliud.json');
+ $cut = new PJsonCurl('file:///'.__DIR__.'/testinvalid.json');
//then
$this->setExpectedException('PurpleCode\PCurl\PCurlException');