function FileFieldTestBase::assertFileExists

Asserts that a file exists physically on disk.

File

core/modules/file/src/Tests/FileFieldTestBase.php, line 272

Class

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

Namespace

Drupal\file\Tests

Code

public function assertFileExists($file, $message = NULL) {
    $message = isset($message) ? $message : new FormattableMarkup('File %file exists on the disk.', [
        '%file' => $file->getFileUri(),
    ]);
    $this->assertTrue(is_file($file->getFileUri()), $message);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.