You are here

function MediaFileFieldTestCase::assertFileEntryExists in D7 Media 7.2

Same name and namespace in other branches
  1. 7.4 tests/media.test \MediaFileFieldTestCase::assertFileEntryExists()
  2. 7.3 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);
}