SimpleMock::throwAt PHP Method

throwAt() public method

Sets up a trigger to throw an exception upon the method call.
public throwAt ( integer $timing, string $method, object $exception = false, array $args = false )
$timing integer When to throw the exception. A value of 0 throws immediately. A value of 1 actually allows one call to this method before throwing. 2 will allow two calls before throwing and so on.
$method string Method name to throw on.
$exception object Exception object to throw. If not given then a simple Exception object is thrown.
$args array Optional argument list filter. If given then the exception will only be thrown if the method call matches the arguments.
    public function throwAt($timing, $method, $exception = false, $args = false)
    {
        $this->dieOnNoMethod($method, 'throw at');
        $this->actions->registerAt($timing, $method, $args, new SimpleThrower($exception ? $exception : new Exception()));
    }