You are here

function FileLoadTest::testLoadMissingFilepath in Drupal 7

Try to load a non-existent file by URI.

File

modules/simpletest/tests/file.test, line 2077
This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.

Class

FileLoadTest
Tests the file_load() function.

Code

function testLoadMissingFilepath() {
  $files = file_load_multiple(array(), array(
    'uri' => 'foobar://misc/druplicon.png',
  ));
  $this
    ->assertFalse(reset($files), "Try to load a file that doesn't exist in the database fails.");
  $this
    ->assertFileHooksCalled(array());
}