function UnmanagedCopyTest::testNonExistent

Copy a non-existent file.

File

drupal/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php, line 55
Definition of Drupal\system\Tests\File\UnmanagedCopyTest.

Class

UnmanagedCopyTest
Unmanaged copy related tests.

Namespace

Drupal\system\Tests\File

Code

function testNonExistent() {

  // Copy non-existent file
  $desired_filepath = $this
    ->randomName();
  $this
    ->assertFalse(file_exists($desired_filepath), "Randomly named file doesn't exists.");
  $new_filepath = file_unmanaged_copy($desired_filepath, $this
    ->randomName());
  $this
    ->assertFalse($new_filepath, 'Copying a missing file fails.');
}