You are here

function FileUnmanagedDeleteRecursiveTest::testEmptyDirectory in Drupal 7

Try deleting an empty directory.

File

modules/simpletest/tests/file.test, line 1436
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.');
}