1 file.test | FileUnmanagedDeleteTest::testNormal() |
Delete a normal file.
File
- core/
modules/ simpletest/ tests/ file.test, line 1416 - This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.
Class
- FileUnmanagedDeleteTest
- Deletion related tests.
Code
function testNormal() {
// Create a file for testing
$file = $this->createFile();
// Delete a regular file
$this->assertTrue(file_unmanaged_delete($file->uri), 'Deleted worked.');
$this->assertFalse(file_exists($file->uri), 'Test file has actually been deleted.');
}