. */ //require 'Yay/MockObject.php'; //require 'Yay/Invocation.php'; //require 'Yay/Action.php'; //require 'Yay/SelfDescribing.php'; //require 'Yay/State.php'; //require 'Yay/StatePredicate.php'; //require 'Yay/Sequence.php'; /** * An Invocation expectation. * @author Chris Corbyn * @package Yay */ interface Yay_Expectation extends Yay_SelfDescribing { /** * Specify the MockObject which the Invocation will occur. * This method should return the mock object in record mode. * @param Yay_MockObject $mock * @return Yay_MockObject */ public function of(Yay_MockObject $mock); /** * Notify the Expectation of an Invocation and check if it matches. * @param Yay_Invocation $invocation * @return boolean */ public function isExpected(Yay_Invocation $invocation); /** * Specify the Action to run if a match occurs. * @param Yay_Action $action */ public function will(Yay_Action $action); /** * Only be expected when in the given State predicate. * @param Yay_StatePredicate $predicate */ public function when(Yay_StatePredicate $predicate); /** * Activate the given $state if a match occurs. * @param Yay_State $state */ public function then(Yay_State $state); /** * Constrain this expectation to be valid only if invoked in the given sequence. * @param Yay_Sequence $sequence */ public function inSequence(Yay_Sequence $sequence); /** * Test if all conditions of the Invocation are satisfied. * @return boolean */ public function isSatisfied(); /** * Get the Action for the given Invocation. * This may have been specified by a will() clause. * @param Yay_Invocation $invocation * @return Yay_Action */ public function getAction(Yay_Invocation $invocation); }