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 * Records invocations and provides convenience methods for checking them later
14 * This abstract class can be implemented by matchers which needs to check the
15 * number of times an invocation has occured.
17 * @since Class available since Release 1.0.0
20 abstract class PHPUnit_Framework_MockObject_Matcher_InvokedRecorder implements PHPUnit_Framework_MockObject_Matcher_Invocation
23 * @var PHPUnit_Framework_MockObject_Invocation[]
25 protected $invocations = array();
30 public function getInvocationCount()
32 return count($this->invocations);
36 * @return PHPUnit_Framework_MockObject_Invocation[]
38 public function getInvocations()
40 return $this->invocations;
46 public function hasBeenInvoked()
48 return count($this->invocations) > 0;
52 * @param PHPUnit_Framework_MockObject_Invocation $invocation
54 public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation)
56 $this->invocations[] = $invocation;
60 * @param PHPUnit_Framework_MockObject_Invocation $invocation
63 public function matches(PHPUnit_Framework_MockObject_Invocation $invocation)