PHPUnit_Framework_MockObject_Invocation $invocation:
PHPUnit_Framework_ExpectationFailedException
Overrides PHPUnit_Framework_MockObject_Matcher_InvokedRecorder::invoked
public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation) {
parent::invoked($invocation);
$count = $this
->getInvocationCount();
if ($count > $this->expectedCount) {
$message = $invocation
->toString() . ' ';
switch ($this->expectedCount) {
case 0:
$message .= 'was not expected to be called.';
break;
case 1:
$message .= 'was not expected to be called more than once.';
break;
default:
$message .= sprintf('was not expected to be called more than %d times.', $this->expectedCount);
}
throw new PHPUnit_Framework_ExpectationFailedException($message);
}
}