Is there a way to assert mocked class method string parameter for multiple matches?
$this->getMock()
->expects($this->any())
->method('setString')
->with($this->stringContains('word3'))
->will($this->returnSelf());
This example will pass for ->setString('word1 word2 word3 word4')
What I need to do is match if setString() is called with parameter containing 'word1' AND 'word3'
But
$this->getMock()
->expects($this->any())
->method('setString')
->with(
$this->stringContains('word1'),
$this->stringContains('word3')
)
->will($this->returnSelf());
this implementation is checking for 2 parameters for setString() and this is not what I have intended to check.
Ideas? using $this->callback() ? Is there some better suited PHPUnit assertions for this?