public function FileDeleteTest::testNormal in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php \Drupal\KernelTests\Core\File\FileDeleteTest::testNormal()
Delete a normal file.
File
- core/
tests/ Drupal/ KernelTests/ Core/ File/ FileDeleteTest.php, line 17
Class
- FileDeleteTest
- Tests the unmanaged file delete function.
Namespace
Drupal\KernelTests\Core\FileCode
public function testNormal() {
// Create a file for testing
$uri = $this
->createUri();
// Delete a regular file
$this
->assertTrue(\Drupal::service('file_system')
->delete($uri), 'Deleted worked.');
$this
->assertFileDoesNotExist($uri);
}