mock_objects.php
public function errorAt($timing, $method, $error = 'A mock error', $args = false, $severity = E_USER_ERROR)
    {
        $this->dieOnNoMethod($method, 'error at');
        $this->actions->registerAt($timing, $method, $args, new SimpleErrorThrower($error, $severity));
    }
public function errorAt($timing, $method, $error = 'A mock error', $args = false, $severity = E_USER_ERROR)
    {
        $this->dieOnNoMethod($method, 'error at');
        $this->actions->registerAt($timing, $method, $args, new SimpleErrorThrower($error, $severity));
    }
Sets up a trigger to throw an error upon a specific method call.

@param int    $timing   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.
@param string $method   Method name to throw on.
@param object $error    Error message to trigger.
@param array  $args     Optional argument list filter.
If given then the exception
will only be thrown if the
method call matches the arguments.
@param int    $severity The PHP severity level. Defaults to E_USER_ERROR.