You are here

function UnmanagedDeleteTest::testDirectory in Zircon Profile 8

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

Try deleting a directory.

File

core/modules/system/src/Tests/File/UnmanagedDeleteTest.php, line 39
Contains \Drupal\system\Tests\File\UnmanagedDeleteTest.

Class

UnmanagedDeleteTest
Tests the unmanaged file delete function.

Namespace

Drupal\system\Tests\File

Code

function testDirectory() {

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

  // Try to delete a directory
  $this
    ->assertFalse(file_unmanaged_delete($directory), 'Could not delete the delete directory.');
  $this
    ->assertTrue(file_exists($directory), 'Directory has not been deleted.');
}