function FileDeleteRecursiveRemoteTest::testEmptyDirectory

Same name and namespace in other branches
  1. main core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveRemoteTest.php \Drupal\KernelTests\Core\File\FileDeleteRecursiveRemoteTest::testEmptyDirectory()

Tests deleting an empty directory via a remote stream wrapper.

File

core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveRemoteTest.php, line 58

Class

FileDeleteRecursiveRemoteTest
Tests deleteRecursive() with remote stream wrappers where realpath() is FALSE.

Namespace

Drupal\KernelTests\Core\File

Code

public function testEmptyDirectory() : void {
  $directory = $this->createDirectory('dummy-remote://' . $this->randomMachineName());
  $this->assertTrue(\Drupal::service('file_system')->deleteRecursive($directory));
  $this->assertDirectoryDoesNotExist($directory);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.