lithium\test\Unit::assertFileNotEquals()

public method

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

$this->assertFileNotEquals('/tmp/foo.txt', '/tmp/bar.txt'); // succeeds
$this->assertFileNotEquals('/tmp/foo.txt', '/tmp/foo.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 assertFileNotEquals($expected, $actual, $message = '{:message}') {
		$expected = md5_file($expected);
		$result = md5_file($actual);
		return $this->assert($expected !== $result, $message, compact('expected', 'result'));
	}