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 */ 17interface 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 Object containing information on a mocked or stubbed method which was invoked 31 * 32 * @return mixed 33 */ 34 public function invoked(PHPUnit_Framework_MockObject_Invocation $invocation); 35 36 /** 37 * Checks if the invocation $invocation matches the current rules. If it does 38 * the matcher will get the invoked() method called which should check if an 39 * expectation is met. 40 * 41 * @param PHPUnit_Framework_MockObject_Invocation $invocation Object containing information on a mocked or stubbed method which was invoked 42 * 43 * @return bool 44 */ 45 public function matches(PHPUnit_Framework_MockObject_Invocation $invocation); 46} 47