mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Added tests to get with queryparams and custom configs. Refs #1674.
This commit is contained in:
parent
9db411d9e4
commit
1962e40c9a
1 changed files with 28 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue