Maybe I'm also doing something wrong with the Request object.
-- In the Integration Controller Test, when I $this->cookie('x',y');
And in the controller when I $this->loadComponent('Cookie'); print_r($this->Cookie->read('x'));
Nothing displays. Am I doing it the right way or is something missing?
On Monday, May 11, 2015 at 9:53:23 PM UTC-7, HVan wrote:
On Monday, May 11, 2015 at 9:53:23 PM UTC-7, HVan wrote:
I wrote a test that posts data like this:$data = [ 'Clients[username]'=>'asdf' ];$this->post('/url',$data);In the controller method, when I print_r $this->request->data, it displays as this:[ 'Clients[username]'=>'asdf' ]However, if I go through a browser instead of phpunit, it is formed as such:[ ['Clients'=>['username'=>'asdf'] ] ] which allows me to patchEntity or use newEntity with that data. So my question is, what is the proper way to post data when Integration Testing a controller?
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment