function MediaFileFieldTestCase::assertFileEntryExists in D7 Media 7.3
Same name and namespace in other branches
- 7.4 tests/media.test \MediaFileFieldTestCase::assertFileEntryExists()
- 7.2 tests/media.test \MediaFileFieldTestCase::assertFileEntryExists()
Asserts that a file exists in the database.
2 calls to MediaFileFieldTestCase::assertFileEntryExists()
- MediaFileFieldRevisionTestCase::testRevisions in tests/
media.test - Tests creating multiple revisions of a node and managing attached files.
- MediaFileFieldValidateTestCase::testRequired in tests/
media.test - Tests the required property on file fields.
File
- tests/
media.test, line 215 - Tests for media.module.
Class
- MediaFileFieldTestCase
- Provides methods specifically for testing Media module's field handling.
Code
function assertFileEntryExists($file, $message = NULL) {
entity_get_controller('file')
->resetCache();
$db_file = file_load($file->fid);
$message = isset($message) ? $message : format_string('File %file exists in database at the correct path.', array(
'%file' => $file->uri,
));
$this
->assertEqual($db_file->uri, $file->uri, $message);
}