lithium\test\Unit::assertEmpty()

public method

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

boolean

true if the assertion succeeded, false otherwise.

Source

	public function assertEmpty($actual, $message = '{:message}') {
		return $this->assert(empty($actual), $message, [
			'expected' => $actual,
			'result' => empty($actual)
		]);
	}