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
Post a Comment