From 6b40d6be7e03aa5d7b68098412dba5593018d956 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 11 May 2014 23:39:00 +0200 Subject: [PATCH] Fixed assert error message; added new method --- src/Assert.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Assert.php b/src/Assert.php index 58d01589..b8fa12ac 100644 --- a/src/Assert.php +++ b/src/Assert.php @@ -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)