function FileDeleteRecursiveRemoteTest::testSingleFile

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

Tests deleting a single file via a remote stream wrapper.

File

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

Class

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

Namespace

Drupal\KernelTests\Core\File

Code

public function testSingleFile() : void {
  $filepath = 'dummy-remote://' . $this->randomMachineName();
  file_put_contents($filepath, '');
  $this->assertTrue(\Drupal::service('file_system')->deleteRecursive($filepath));
  $this->assertFileDoesNotExist($filepath);
}

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