public function FileFieldTestBase::assertFileExists in Drupal 8
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\TestsCode
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);
}