You are here

public function LoadTest::testLoadMissingFid in Drupal 9

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

Try to load a non-existent file by fid.

File

core/modules/file/tests/src/Kernel/LoadTest.php, line 18

Class

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

Namespace

Drupal\Tests\file\Kernel

Code

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