function LoadTest::testLoadMissingFid
Try to load a non-existent file by fid.
File
-
core/
modules/ file/ tests/ src/ Kernel/ LoadTest.php, line 20
Class
- LoadTest
- Tests \Drupal\file\Entity\File::load().
Namespace
Drupal\Tests\file\KernelCode
public function testLoadMissingFid() : void {
$this->assertNull(File::load(-1), 'Try to load an invalid fid fails.');
$this->assertFileHooksCalled([]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.