FileUnmanagedCopyTest::testNonExistent

7 file.test FileUnmanagedCopyTest::testNonExistent()
8 file.test FileUnmanagedCopyTest::testNonExistent()

Copy a non-existent file.

File

modules/simpletest/tests/file.test, line 1472
This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.

Code

function testNonExistent() {
  // Copy non-existent file
  $desired_filepath = $this->randomName();
  $this->assertFalse(file_exists($desired_filepath), t("Randomly named file doesn't exists."));
  $new_filepath = file_unmanaged_copy($desired_filepath, $this->randomName());
  $this->assertFalse($new_filepath, t('Copying a missing file fails.'));
}
Login or register to post comments