I want to test a function with this header:
public function includeNumComments($posts){
Where $post is an array of data.
I wonder how can i test the method passing it an array of posts.
I have tried things like this, but it doesn’t work:
$result = $this->testAction("/comments/includeNumComments/", array('data' => $posts));
$result = $this->testAction("/comments/includeNumComments/", array($posts));
Thanks
That’s not really using
testActionthen, because you can’t pass an array via HTTP. There’d be no way to do this via a form or link on a website.You can just test it as a normal function: