function FileMoveTest::testMissing

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php \Drupal\KernelTests\Core\File\FileMoveTest::testMissing()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php \Drupal\KernelTests\Core\File\FileMoveTest::testMissing()
  3. 10 core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php \Drupal\KernelTests\Core\File\FileMoveTest::testMissing()

Try to move a missing file.

File

core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php, line 56

Class

FileMoveTest
Tests the unmanaged file move function.

Namespace

Drupal\KernelTests\Core\File

Code

public function testMissing() : void {
    // Move non-existent file.
    $this->expectException(FileNotExistsException::class);
    \Drupal::service('file_system')->move($this->randomMachineName(), $this->randomMachineName());
}

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