For the code below,
$mockObject->expects($this->at(0))
->method('search')
->with($searchConfig)
->will($this->returnValue([]));
This line will automatic make a assertensure that when it call method search it must contain $searchConfig parameters. In this case, we have to provide totally matched $searchConfig but sometime it is hard if it is an array or an object.
Are there any possible way to let PHPUnit call to some specific method to assert that it contains arguments pass in a method as we want?
For example, I may create closure function to assert as below instead of using ->with() method
function ($config){
$this->assertFalse(isset($config['shouldnothere']));
$this->assertTrue($config['object']->isValidValue());
}