Fixed assert error message; added new method
This commit is contained in:
parent
72821157dd
commit
6b40d6be7e
1 changed files with 7 additions and 1 deletions
|
@ -35,10 +35,16 @@ class Assert
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isNull($actual)
|
||||||
|
{
|
||||||
|
if ($actual !== null and $actual !== false)
|
||||||
|
$this->fail('Assertion failed. Expected: NULL, got: "' . $actual . '"');
|
||||||
|
}
|
||||||
|
|
||||||
public function isNotNull($actual)
|
public function isNotNull($actual)
|
||||||
{
|
{
|
||||||
if ($actual === null or $actual === false)
|
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)
|
public function isTrue($actual)
|
||||||
|
|
Loading…
Reference in a new issue