1 file.test FileUnmanagedDeleteRecursiveTest::testEmptyDirectory()

Try deleting an empty directory.

File

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

Class

FileUnmanagedDeleteRecursiveTest
Deletion related tests.

Code

function testEmptyDirectory() {
  // A directory to operate on.
  $directory = $this->createDirectory();

  // Delete the directory.
  $this->assertTrue(file_unmanaged_delete_recursive($directory), 'Function reported success.');
  $this->assertFalse(file_exists($directory), 'Directory has been deleted.');
}