Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Nov 14, 2014
2 parents ffd4e9b + 2aef442 commit 6f51441
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,36 @@ public function testPrepareHeadersCreateRightHttpField()
$this->assertArrayNotHasKey('content-length', $headers);
$this->assertArrayHasKey('Content-Length', $headers);
}

/**
* @group 6231
*/
public function testHttpQueryParametersCastToString()
{
$client = new Client();

/* @var $adapter \PHPUnit_Framework_MockObject_MockObject|\Zend\Http\Client\Adapter\AdapterInterface */
$adapter = $this->getMock('Zend\Http\Client\Adapter\AdapterInterface');

$client->setAdapter($adapter);

$request = new Request();

$request->setUri('http://example.com/');
$request->getQuery()->set('foo', 'bar');

$response = new Response();

$adapter
->expects($this->once())
->method('write')
->with(Request::METHOD_GET, 'http://example.com/?foo=bar');

$adapter
->expects($this->any())
->method('read')
->will($this->returnValue($response->toString()));

$client->send($request);
}
}

0 comments on commit 6f51441

Please sign in to comment.