Chris@14: Chris@14: * Chris@14: * For the full copyright and license information, please view the LICENSE Chris@14: * file that was distributed with this source code. Chris@14: */ Chris@14: namespace PHPUnit\Framework\MockObject\Matcher; Chris@14: Chris@14: use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; Chris@14: Chris@14: /** Chris@14: * Invocation matcher which does not care about previous state from earlier Chris@14: * invocations. Chris@14: * Chris@14: * This abstract class can be implemented by matchers which does not care about Chris@14: * state but only the current run-time value of the invocation itself. Chris@14: */ Chris@14: abstract class StatelessInvocation implements Invocation Chris@14: { Chris@14: /** Chris@14: * Registers the invocation $invocation in the object as being invoked. Chris@14: * This will only occur after matches() returns true which means the Chris@14: * current invocation is the correct one. Chris@14: * Chris@14: * The matcher can store information from the invocation which can later Chris@14: * be checked in verify(), or it can check the values directly and throw Chris@14: * and exception if an expectation is not met. Chris@14: * Chris@14: * If the matcher is a stub it will also have a return value. Chris@14: * Chris@14: * @param BaseInvocation $invocation Object containing information on a mocked or stubbed method which was invoked Chris@14: * Chris@14: * @return mixed Chris@14: */ Chris@14: public function invoked(BaseInvocation $invocation) Chris@14: { Chris@14: } Chris@14: Chris@14: /** Chris@14: * Checks if the invocation $invocation matches the current rules. If it does Chris@14: * the matcher will get the invoked() method called which should check if an Chris@14: * expectation is met. Chris@14: * Chris@14: * @param Invocation $invocation Object containing information on a mocked or stubbed method which was invoked Chris@14: * Chris@14: * @return bool Chris@14: */ Chris@14: public function verify() Chris@14: { Chris@14: } Chris@14: }