lithium\test\Unit::assertEmpty()
Assert that given result is empty.
$this->assertEmpty(''); // succeeds
$this->assertEmpty(0); // succeeds
$this->assertEmpty(0.0); // succeeds
$this->assertEmpty('0'); // succeeds
$this->assertEmpty(null); // succeeds
$this->assertEmpty(false); // succeeds
$this->assertEmpty([]); // succeeds
$this->assertEmpty(1); // fails
Parameters
-
string
$actual
-
string|boolean
$message
Returns
booleantrue
if the assertion succeeded, false
otherwise.
Links
Source
public function assertEmpty($actual, $message = '{:message}') {
return $this->assert(empty($actual), $message, [
'expected' => $actual,
'result' => empty($actual)
]);
}