$authCookies
$authCookies : array
ApiTestCase is the base class for testing all RESTful API controller methods.
Usage:
$response = $this->post(
'api/login',
array(
'username'=>'userName',
'password'=>'password'
),
array(
CURLOPT_CRLF=>true,
'cookies'=>array(
'giud'=>'value',
...
)
)
);
request(string $url, array $params, array $options) : array
Function executes curl request
| string | $url | URL |
| array | $params | request parameters |
| array | $options | additional request options |
response
array{
'body' => "response content",
'code' => 200,
'location' => 'http://www.example.org/index.php',
'cookies' => array(...)
'headers' => array(...)
}
http_parse_headers(string $header) : array
Function convert HTTP headers to array
| string | $header |
HTTP headers
Example:
array(
'Date' =>" Tue, 18 Mar 2014 11:50:12 GMT",
'Server' => "Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9",
'X-Powered-By' =>"PHP/5.5.9",
'Set-Cookie' => array(
'PHPSESSID' =>array(
'value' => "ou85gd41ad8rlgme12dps41ki4",
'path' => "/"
)
'guid' => array(
'value' => "53283b69df9cc8.91971156",
'expires' => 1397737577,
'Max-Age' => "2592000",
'path' => "/",
)
),
'Expires' => "Thu, 19 Nov 1981 08:52:00 GMT",
'Cache-Control' =>"no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
'Pragma' =>"no-cache",
'Content-Length' =>"204",
'Content-Type' =>"application/json",
)