You are here

public function FileDeleteTest::testMissing in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php \Drupal\KernelTests\Core\File\FileDeleteTest::testMissing()
  2. 10 core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php \Drupal\KernelTests\Core\File\FileDeleteTest::testMissing()

Try deleting a missing file.

File

core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php, line 29

Class

FileDeleteTest
Tests the unmanaged file delete function.

Namespace

Drupal\KernelTests\Core\File

Code

public function testMissing() {

  // Try to delete a non-existing file
  $this
    ->assertTrue(\Drupal::service('file_system')
    ->delete('public://' . $this
    ->randomMachineName()), 'Returns true when deleting a non-existent file.');
}