3 * This file is part of the PHPUnit_MockObject package.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
12 * Invocation matcher which checks if a method has been invoked at least one
15 * If the number of invocations is 0 it will throw an exception in verify.
17 * @since Class available since Release 1.0.0
19 class PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce extends PHPUnit_Framework_MockObject_Matcher_InvokedRecorder
24 public function toString()
26 return 'invoked at least once';
30 * Verifies that the current expectation is valid. If everything is OK the
31 * code should just return, if not it must throw an exception.
33 * @throws PHPUnit_Framework_ExpectationFailedException
35 public function verify()
37 $count = $this->getInvocationCount();
40 throw new PHPUnit_Framework_ExpectationFailedException(
41 'Expected invocation at least once but it never occured.'