UnmanagedDeleteTest.php in Zircon Profile 8.0
File
core/modules/system/src/Tests/File/UnmanagedDeleteTest.php
View source
<?php
namespace Drupal\system\Tests\File;
class UnmanagedDeleteTest extends FileTestBase {
function testNormal() {
$uri = $this
->createUri();
$this
->assertTrue(file_unmanaged_delete($uri), 'Deleted worked.');
$this
->assertFalse(file_exists($uri), 'Test file has actually been deleted.');
}
function testMissing() {
$this
->assertTrue(file_unmanaged_delete(file_default_scheme() . '/' . $this
->randomMachineName()), 'Returns true when deleting a non-existent file.');
}
function testDirectory() {
$directory = $this
->createDirectory();
$this
->assertFalse(file_unmanaged_delete($directory), 'Could not delete the delete directory.');
$this
->assertTrue(file_exists($directory), 'Directory has not been deleted.');
}
}