mock atLeastOnce with concrete value, the rest not important
问题 The question is in PHP , but applies to any language using the xUnit framework. I want a mock, that expects 140 calls to method jump . I need to verify, that at least once there is a call with 500 as parameter. I don't care if all the calls are 500, but I need at least one that is called with 500. $mock = $this->getMock('Trampoline', ['jump']); $mock->expects($this->atLeastOnce()) ->method('jump') ->with($this->equalTo(500)) ->will($this->returnValue(true)); $sportsman->setTramploine($mock);