This commit is contained in:
thefosk
2014-01-08 18:50:12 -08:00
parent bbdc248550
commit 7ea2f5f750

View File

@@ -16,6 +16,20 @@ class UnirestTest extends UnitTestCase
$this->assertEqual("thefosk", $args->nick); $this->assertEqual("thefosk", $args->nick);
} }
public function testGetMultidimensionalArray()
{
$response = Unirest::get("http://httpbin.org/get", array( "Accept" => "application/json" ),
array('key'=>'value','items'=>array('item1','item2')));
$this->assertEqual(200, $response->code);
$args = $response->body->args;
print_r($args);
$this->assertEqual("Mark", $args->{"user.name"});
$this->assertEqual("thefosk", $args->nick);
}
public function testGetWithDots() public function testGetWithDots()
{ {
$response = Unirest::get("http://httpbin.org/get", array( "Accept" => "application/json" ), $response = Unirest::get("http://httpbin.org/get", array( "Accept" => "application/json" ),