function LoadTest::testLoadMissingFilepath

Try to load a non-existent file by URI.

File

drupal/core/modules/file/lib/Drupal/file/Tests/LoadTest.php, line 33
Definition of Drupal\file\Tests\LoadTest.

Class

LoadTest
Tests the file_load() function.

Namespace

Drupal\file\Tests

Code

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