added assertNull() and assertNotNull()
This commit is contained in:
parent
6737c5cea4
commit
04e4a9ce26
1 changed files with 25 additions and 6 deletions
|
@ -62,6 +62,25 @@ class UnitTestCase
|
||||||
$this->_fail();
|
$this->_fail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function assertNull($expr)
|
||||||
|
{
|
||||||
|
if (is_null($expr)) {
|
||||||
|
$this->pass();
|
||||||
|
} else {
|
||||||
|
$this->fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function assertNotNull($expr)
|
||||||
|
{
|
||||||
|
if (is_null($expr)) {
|
||||||
|
$this->fail();
|
||||||
|
} else {
|
||||||
|
$this->pass();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function pass()
|
public function pass()
|
||||||
{
|
{
|
||||||
$this->_passed++;
|
$this->_passed++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue