You are here

public function PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex::verify in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtIndex.php \PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex::verify()

Verifies that the current expectation is valid. If everything is OK the code should just return, if not it must throw an exception.

Throws

PHPUnit_Framework_ExpectationFailedException

Overrides PHPUnit_Framework_MockObject_Verifiable::verify

File

vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtIndex.php, line 75

Class

PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
Invocation matcher which checks if a method was invoked at a certain index.

Code

public function verify() {
  if ($this->currentIndex < $this->sequenceIndex) {
    throw new PHPUnit_Framework_ExpectationFailedException(sprintf('The expected invocation at index %s was never reached.', $this->sequenceIndex));
  }
}