I know this answer is quite late, but I had the same problem and found a solution that seems to be a little bit smarter... :)
Try this: (untested for your case)
$this->getMock()
->expects($this->any())
->method('setString')
->with($this->logicalAnd(
$this->stringContains('word1'),
$this->stringContains('word3')
))
->will($this->returnSelf());