Chris@0
|
1 <?php
|
Chris@0
|
2 /*
|
Chris@0
|
3 * This file is part of the PHPUnit_MockObject package.
|
Chris@0
|
4 *
|
Chris@0
|
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
|
Chris@0
|
6 *
|
Chris@0
|
7 * For the full copyright and license information, please view the LICENSE
|
Chris@0
|
8 * file that was distributed with this source code.
|
Chris@0
|
9 */
|
Chris@0
|
10
|
Chris@0
|
11 /**
|
Chris@0
|
12 * Interface for classes which matches an invocation based on its
|
Chris@0
|
13 * method name, argument, order or call count.
|
Chris@0
|
14 *
|
Chris@0
|
15 * @since Interface available since Release 1.0.0
|
Chris@0
|
16 */
|
Chris@0
|
17 interface PHPUnit_Framework_MockObject_Matcher_Invocation extends PHPUnit_Framework_SelfDescribing, PHPUnit_Framework_MockObject_Verifiable
|
Chris@0
|
18 {
|
Chris@0
|
19 /**
|
Chris@0
|
20 * Registers the invocation $invocation in the object as being invoked.
|
Chris@0
|
21 * This will only occur after matches() returns true which means the
|
Chris@0
|
22 * current invocation is the correct one.
|
Chris@0
|
23 *
|
Chris@0
|
24 * The matcher can store information from the invocation which can later
|
Chris@0
|
25 * be checked in verify(), or it can check the values directly and throw
|
Chris@0
|
26 * and exception if an expectation is not met.
|
Chris@0
|
27 *
|
Chris@0
|
28 * If the matcher is a stub it will also have a return value.
|
Chris@0
|
29 *
|
Chris@0
|
30 * @param PHPUnit_Framework_MockObject_Invocation $invocation
|
Chris@0
|
31 * Object containing information on a mocked or stubbed method which
|
Chris@0
|
32 * was invoked.
|
Chris@0
|
33 * @return mixed
|
Chris@0
|
34 */
|
Chris@0
|
35 public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation);
|
Chris@0
|
36
|
Chris@0
|
37 /**
|
Chris@0
|
38 * Checks if the invocation $invocation matches the current rules. If it does
|
Chris@0
|
39 * the matcher will get the invoked() method called which should check if an
|
Chris@0
|
40 * expectation is met.
|
Chris@0
|
41 *
|
Chris@0
|
42 * @param PHPUnit_Framework_MockObject_Invocation $invocation
|
Chris@0
|
43 * Object containing information on a mocked or stubbed method which
|
Chris@0
|
44 * was invoked.
|
Chris@0
|
45 * @return bool
|
Chris@0
|
46 */
|
Chris@0
|
47 public function matches(PHPUnit_Framework_MockObject_Invocation $invocation);
|
Chris@0
|
48 }
|