You are here

public function FileRepositoryTest::testLoadByUri in Drupal 10

Tests loading a file by URI.

@covers ::loadByUri

File

core/modules/file/tests/src/Kernel/FileRepositoryTest.php, line 206

Class

FileRepositoryTest
Tests the FileRepository.

Namespace

Drupal\Tests\file\Kernel

Code

public function testLoadByUri() {
  $source = $this
    ->createFile();
  $result = $this->fileRepository
    ->loadByUri($source
    ->getFileUri());
  $this
    ->assertSameFile($source, $result);
}