function FileRepositoryTest::testLoadByUri
Same name in other branches
- 10 core/modules/file/tests/src/Kernel/FileRepositoryTest.php \Drupal\Tests\file\Kernel\FileRepositoryTest::testLoadByUri()
- 11.x core/modules/file/tests/src/Kernel/FileRepositoryTest.php \Drupal\Tests\file\Kernel\FileRepositoryTest::testLoadByUri()
Tests loading a file by URI.
@covers ::loadByUri
File
-
core/
modules/ file/ tests/ src/ Kernel/ FileRepositoryTest.php, line 207
Class
- FileRepositoryTest
- Tests the FileRepository.
Namespace
Drupal\Tests\file\KernelCode
public function testLoadByUri() {
$source = $this->createFile();
$result = $this->fileRepository
->loadByUri($source->getFileUri());
$this->assertSameFile($source, $result);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.