Added tests to get with queryparams and custom configs. Refs #1674.

This commit is contained in:
Juan Basso 2011-04-26 22:10:24 -04:00
parent 9db411d9e4
commit 1962e40c9a

View file

@ -595,6 +595,34 @@ class HttpSocketTest extends CakeTestCase {
$this->assertFalse($this->Socket->connected);
}
/**
* testRequestWithConstructor method
*
* @return void
*/
public function testRequestWithConstructor() {
$request = array(
'request' => array(
'uri' => array(
'scheme' => 'http',
'host' => 'localhost',
'port' => '5984',
'user' => null,
'pass' => null
)
)
);
$http = new MockHttpSocketRequests($request);
$expected = array('method' => 'GET', 'uri' => '/_test');
$http->expects($this->at(0))->method('request')->with($expected);
$http->get('/_test');
$expected = array('method' => 'GET', 'uri' => 'http://localhost:5984/_test?count=4');
$http->expects($this->at(0))->method('request')->with($expected);
$http->get('/_test', array('count' => 4));
}
/**
* testRequestWithResource
*