function FileRepositoryTest::testLoadByUriCaseSensitive

Same name in other branches
  1. 9 core/modules/file/tests/src/Kernel/FileRepositoryTest.php \Drupal\Tests\file\Kernel\FileRepositoryTest::testLoadByUriCaseSensitive()
  2. 10 core/modules/file/tests/src/Kernel/FileRepositoryTest.php \Drupal\Tests\file\Kernel\FileRepositoryTest::testLoadByUriCaseSensitive()

Tests loading a file by case-sensitive URI.

@covers ::loadByUri

File

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

Class

FileRepositoryTest
Tests the FileRepository.

Namespace

Drupal\Tests\file\Kernel

Code

public function testLoadByUriCaseSensitive() : void {
    $source = $this->createFile('FooBar.txt');
    $result = $this->fileRepository
        ->loadByUri('public://FooBar.txt');
    $this->assertSameFile($source, $result);
    $result = $this->fileRepository
        ->loadByUri('public://foobar.txt');
    $this->assertNull($result);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.