You are here

public function FileFieldTestBase::assertFileIsPermanent in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/file/tests/src/Functional/FileFieldTestBase.php \Drupal\Tests\file\Functional\FileFieldTestBase::assertFileIsPermanent()
  2. 10 core/modules/file/tests/src/Functional/FileFieldTestBase.php \Drupal\Tests\file\Functional\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/tests/src/Functional/FileFieldRevisionTest.php
Tests creating multiple revisions of a node and managing attached files.

File

core/modules/file/tests/src/Functional/FileFieldTestBase.php, line 241

Class

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

Namespace

Drupal\Tests\file\Functional

Code

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