unit testing - Method with argument of AbstractController phpunit. Any hints -


i need test method looks this, question is: how should enter method when can not "mock" abstractcontroller, , without variable of abstractcontroller not work

public function add(\queue\controller\abstractqueuecontroller $task)  {        //logic of method          } 

you don't need mock it. set parameter, test not testing abstractqueuecontroller.

so, example, if function looks :

public function add(\queue\controller\abstractqueuecontroller $task)  {    $task->dosomething(); } 

then, in test,abstractqueuecontroller should receive call dosomething method(), , assert result of that.


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -