new test to validate #58
This commit is contained in:
@@ -171,7 +171,10 @@ class UnirestRequestTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$args = $response->body->args;
|
$args = $response->body->args;
|
||||||
$this->assertEquals('Mark=Hello', $args->name);
|
$this->assertEquals('Mark=Hello', $args->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetWithEqualSignAlt()
|
||||||
|
{
|
||||||
$response = Unirest\Request::get('http://httpbin.org/get', array(
|
$response = Unirest\Request::get('http://httpbin.org/get', array(
|
||||||
'Accept' => 'application/json'
|
'Accept' => 'application/json'
|
||||||
), array(
|
), array(
|
||||||
@@ -184,6 +187,17 @@ class UnirestRequestTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals('Mark=Hello=John', $args->name);
|
$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()
|
public function testGetArray()
|
||||||
{
|
{
|
||||||
$response = Unirest\Request::get('http://httpbin.org/get', array(), array(
|
$response = Unirest\Request::get('http://httpbin.org/get', array(), array(
|
||||||
|
|||||||
Reference in New Issue
Block a user