1 file.test | FileTestCase::assertDifferentFile($file1, $file2) |
Check that two files are not the same by comparing the fid and filepath.
Parameters
$file1: File object to compare.
$file2: File object to compare.
File
- core/
modules/ simpletest/ tests/ file.test, line 78 - This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.
Class
- FileTestCase
- Base class for file tests that adds some additional file specific assertions and helper functions.
Code
function assertDifferentFile($file1, $file2) {
$this->assertNotEqual($file1->fid, $file2->fid, format_string('Files have different ids: %file1 != %file2.', array('%file1' => $file1->fid, '%file2' => $file2->fid)), 'Different file');
$this->assertNotEqual($file1->uri, $file2->uri, format_string('Files have different paths: %file1 != %file2.', array('%file1' => $file1->uri, '%file2' => $file2->uri)), 'Different file');
}