You are here

function FileUnmanagedDeleteTest::testNormal in Drupal 7

Delete a normal file.

File

modules/simpletest/tests/file.test, line 1362
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.');
}