public function LoadTest::testLoadInvalidStatus in Drupal 8
Same name and namespace in other branches
- 9 core/modules/file/tests/src/Kernel/LoadTest.php \Drupal\Tests\file\Kernel\LoadTest::testLoadInvalidStatus()
Try to load a non-existent file by status.
File
- core/
modules/ file/ tests/ src/ Kernel/ LoadTest.php, line 35
Class
- LoadTest
- Tests \Drupal\file\Entity\File::load().
Namespace
Drupal\Tests\file\KernelCode
public function testLoadInvalidStatus() {
$files = \Drupal::entityTypeManager()
->getStorage('file')
->loadByProperties([
'status' => -99,
]);
$this
->assertFalse(reset($files), 'Trying to load a file with an invalid status fails.');
$this
->assertFileHooksCalled([]);
}