From 3eb8536d3d171c4965899ff0cc4b12c19617f5ff Mon Sep 17 00:00:00 2001 From: Ahmad Nassri Date: Thu, 15 Jan 2015 00:30:47 -0500 Subject: [PATCH] new test to validate #58 --- tests/Unirest/RequestTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Unirest/RequestTest.php b/tests/Unirest/RequestTest.php index 00a68aa..e51f773 100644 --- a/tests/Unirest/RequestTest.php +++ b/tests/Unirest/RequestTest.php @@ -171,7 +171,10 @@ class UnirestRequestTest extends \PHPUnit_Framework_TestCase $args = $response->body->args; $this->assertEquals('Mark=Hello', $args->name); + } + public function testGetWithEqualSignAlt() + { $response = Unirest\Request::get('http://httpbin.org/get', array( 'Accept' => 'application/json' ), array( @@ -184,6 +187,17 @@ class UnirestRequestTest extends \PHPUnit_Framework_TestCase $this->assertEquals('Mark=Hello=John', $args->name); } + public function testGetWithComplexQuery() + { + $response = Unirest\Request::get('http://httpbin.org/get?query=[{"type":"/music/album","name":null,"artist":{"id":"/en/bob_dylan"},"limit":3}]&cursor'); + + $this->assertEquals(200, $response->code); + + $args = $response->body->args; + $this->assertEquals('', $args->cursor); + $this->assertEquals('[{"type":"/music/album","name":null,"artist":{"id":"/en/bob_dylan"},"limit":3}]', $args->query); + } + public function testGetArray() { $response = Unirest\Request::get('http://httpbin.org/get', array(), array(