function FileDeleteRecursiveTest::testEmptyDirectory
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php \Drupal\KernelTests\Core\File\FileDeleteRecursiveTest::testEmptyDirectory()
- 8.9.x core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php \Drupal\KernelTests\Core\File\FileDeleteRecursiveTest::testEmptyDirectory()
- 10 core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php \Drupal\KernelTests\Core\File\FileDeleteRecursiveTest::testEmptyDirectory()
Try deleting an empty directory.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ File/ FileDeleteRecursiveTest.php, line 30
Class
- FileDeleteRecursiveTest
- Tests the unmanaged file delete recursive function.
Namespace
Drupal\KernelTests\Core\FileCode
public function testEmptyDirectory() : void {
// A directory to operate on.
$directory = $this->createDirectory();
// Delete the directory.
$this->assertTrue(\Drupal::service('file_system')->deleteRecursive($directory), 'Function reported success.');
$this->assertDirectoryDoesNotExist($directory);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.