You are here

function LoadTest::testLoadMissingFid in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/file/src/Tests/LoadTest.php \Drupal\file\Tests\LoadTest::testLoadMissingFid()

Try to load a non-existent file by fid.

File

core/modules/file/src/Tests/LoadTest.php, line 21
Contains \Drupal\file\Tests\LoadTest.

Class

LoadTest
Tests \Drupal\file\Entity\File::load().

Namespace

Drupal\file\Tests

Code

function testLoadMissingFid() {
  $this
    ->assertFalse(File::load(-1), 'Try to load an invalid fid fails.');
  $this
    ->assertFileHooksCalled(array());
}