You are here

function UnmanagedDeleteRecursiveTest::testEmptyDirectory in Zircon Profile 8

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

Try deleting an empty directory.

File

core/modules/system/src/Tests/File/UnmanagedDeleteRecursiveTest.php, line 32
Contains \Drupal\system\Tests\File\UnmanagedDeleteRecursiveTest.

Class

UnmanagedDeleteRecursiveTest
Tests the unmanaged file delete recursive function.

Namespace

Drupal\system\Tests\File

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.');
}