comparison vendor/phpunit/phpunit-mock-objects/src/Matcher/StatelessInvocation.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents
children
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
1 <?php
2 /*
3 * This file is part of the phpunit-mock-objects 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 namespace PHPUnit\Framework\MockObject\Matcher;
11
12 use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
13
14 /**
15 * Invocation matcher which does not care about previous state from earlier
16 * invocations.
17 *
18 * This abstract class can be implemented by matchers which does not care about
19 * state but only the current run-time value of the invocation itself.
20 */
21 abstract class StatelessInvocation implements Invocation
22 {
23 /**
24 * Registers the invocation $invocation in the object as being invoked.
25 * This will only occur after matches() returns true which means the
26 * current invocation is the correct one.
27 *
28 * The matcher can store information from the invocation which can later
29 * be checked in verify(), or it can check the values directly and throw
30 * and exception if an expectation is not met.
31 *
32 * If the matcher is a stub it will also have a return value.
33 *
34 * @param BaseInvocation $invocation Object containing information on a mocked or stubbed method which was invoked
35 *
36 * @return mixed
37 */
38 public function invoked(BaseInvocation $invocation)
39 {
40 }
41
42 /**
43 * Checks if the invocation $invocation matches the current rules. If it does
44 * the matcher will get the invoked() method called which should check if an
45 * expectation is met.
46 *
47 * @param Invocation $invocation Object containing information on a mocked or stubbed method which was invoked
48 *
49 * @return bool
50 */
51 public function verify()
52 {
53 }
54 }