function FileUnmanagedCopyTest::testNonExistent
Copy a non-existent file.
File
-
modules/
simpletest/ tests/ file.test, line 1678
Class
- FileUnmanagedCopyTest
- Unmanaged copy related tests.
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.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.