You are here

function FileFieldTestBase::assertFileEntryNotExists in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/file/src/Tests/FileFieldTestBase.php \Drupal\file\Tests\FileFieldTestBase::assertFileEntryNotExists()

Asserts that a file does not exist in the database.

1 call to FileFieldTestBase::assertFileEntryNotExists()
FileFieldRevisionTest::testRevisions in core/modules/file/src/Tests/FileFieldRevisionTest.php
Tests creating multiple revisions of a node and managing attached files.

File

core/modules/file/src/Tests/FileFieldTestBase.php, line 291
Contains \Drupal\file\Tests\FileFieldTestBase.

Class

FileFieldTestBase
Provides methods specifically for testing File module's field handling.

Namespace

Drupal\file\Tests

Code

function assertFileEntryNotExists($file, $message) {
  $this->container
    ->get('entity.manager')
    ->getStorage('file')
    ->resetCache();
  $message = isset($message) ? $message : format_string('File %file exists in database at the correct path.', array(
    '%file' => $file
      ->getFileUri(),
  ));
  $this
    ->assertFalse(File::load($file
    ->id()), $message);
}