Fixed assert error message; added new method

This commit is contained in:
Marcin Kurczewski 2014-05-11 23:39:00 +02:00
parent 72821157dd
commit 6b40d6be7e

View file

@ -35,10 +35,16 @@ class Assert
return $ret;
}
public function isNull($actual)
{
if ($actual !== null and $actual !== false)
$this->fail('Assertion failed. Expected: NULL, got: "' . $actual . '"');
}
public function isNotNull($actual)
{
if ($actual === null or $actual === false)
$this->fail('Assertion failed. Expected: NULL, got: "' . $actual . '"');
$this->fail('Assertion failed. Expected: not NULL, got: "' . $actual . '"');
}
public function isTrue($actual)