Horde_Kolab_Server_Integration_Scenario::assertError PHP Метод

assertError() публичный Метод

Ensure that the variable contains a Horde_Kolab_Server_Exception and fail if it does not. Optionally compare the error message with the provided message and fail if both do not match.
public assertError ( mixed $var, string $msg = null ) : NULL.
$var mixed The variable to check.
$msg string The expected error message.
Результат NULL.
    public function assertError($var, $msg = null)
    {
        if (!$var instanceof PEAR_Error) {
            $this->assertInstanceOf('Horde_Kolab_Server_Exception', $var);
            if (isset($msg)) {
                $this->assertEquals($msg, $var->getMessage());
            }
        } else {
            if (isset($msg)) {
                $this->assertEquals($msg, $var->getMessage());
            }
        }
    }