You are here

function FileFieldTestBase::assertFileIsPermanent 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::assertFileIsPermanent()

Asserts that a file's status is set to permanent in the database.

1 call to FileFieldTestBase::assertFileIsPermanent()
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 300
Contains \Drupal\file\Tests\FileFieldTestBase.

Class

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

Namespace

Drupal\file\Tests

Code

function assertFileIsPermanent(FileInterface $file, $message = NULL) {
  $message = isset($message) ? $message : format_string('File %file is permanent.', array(
    '%file' => $file
      ->getFileUri(),
  ));
  $this
    ->assertTrue($file
    ->isPermanent(), $message);
}