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