You are here

function UnmanagedCopyTest::testNonExistent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/File/UnmanagedCopyTest.php \Drupal\system\Tests\File\UnmanagedCopyTest::testNonExistent()

Copy a non-existent file.

File

core/modules/system/src/Tests/File/UnmanagedCopyTest.php, line 52
Contains \Drupal\system\Tests\File\UnmanagedCopyTest.

Class

UnmanagedCopyTest
Tests the unmanaged file copy function.

Namespace

Drupal\system\Tests\File

Code

function testNonExistent() {

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