lithium\test\Unit::assertFileEquals()

public method

Assert that the file contents of $expected are equal to the contents of $actual.

$this->assertFileEquals('/tmp/foo.txt', '/tmp/foo.txt'); // succeeds
$this->assertFileEquals('/tmp/foo.txt', '/tmp/bar.txt'); // fails

Parameters

  • string $expected

    Absolute path to the expected file.

  • string $actual

    Absolute path to the actual file.

  • string|boolean $message

Returns

boolean

true if the assertion succeeded, false otherwise.

Source

	public function assertFileEquals($expected, $actual, $message = '{:message}') {
		$expected = md5_file($expected);
		$result = md5_file($actual);
		return $this->assert($expected === $result, $message, compact('expected', 'result'));
	}