lithium\test\Unit::assertFileExists()

public method

Assert that a file exists.

$this->assertFileExists(__FILE__); // succeeds
$this->assertFileExists('/tmp/bar.txt'); // fails

Parameters

  • string $actual

    Absolute path to the actual file.

  • string|boolean $message

Returns

boolean

true if the assertion succeeded, false otherwise.

Source

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