I am building a test suite in Cakephp using its built in test framework. I am running into the following issue. I have a controller method that when executed makes use of both GET
and POST
data. I know that to simulate GET
data via a test you can easily include that as followed:
$result = $this->testAction('/api/checkuser/', array('data' => $data, 'method' => 'get');
The same thing can be done for POST
as followed:
$result = $this->testAction('/api/currentuser/', array('data' => $data, 'method' => 'post');
But I'm not sure how I would use both together. Does anyone know how to send POST
and GET
data to a given test. Thanks to anyone that can help.
I have never had to send both GET and POST data and the same time, but if you can I imagine it would be something like.
$result = $this->testAction('/api/currentuser/', array('data' => $data, 'method' => array('post', 'get'));
Hope this helps.