3 use MediaWiki\MainConfigNames
;
4 use Wikimedia\FileBackend\FSFileBackend
;
9 class FileRepoTest
extends MediaWikiIntegrationTestCase
{
11 public function testFileRepoConstructionOptionCanNotBeNull() {
12 $this->expectException( InvalidArgumentException
::class );
16 public function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
17 $this->expectException( InvalidArgumentException
::class );
21 public function testFileRepoConstructionOptionNeedNameKey() {
22 $this->expectException( InvalidArgumentException
::class );
28 public function testFileRepoConstructionOptionNeedBackendKey() {
29 $this->expectException( InvalidArgumentException
::class );
35 public function testFileRepoConstructionWithRequiredOptions() {
37 'name' => 'FileRepoTestRepository',
38 'backend' => new FSFileBackend( [
39 'name' => 'local-testing',
40 'wikiId' => 'test_wiki',
41 'containerPaths' => []
44 $this->assertInstanceOf( FileRepo
::class, $f );
47 public function testFileRepoConstructionWithInvalidCasing() {
48 $this->expectException( InvalidArgumentException
::class );
49 $this->expectExceptionMessage( 'File repos with initial capital false' );
51 $this->overrideConfigValue( MainConfigNames
::CapitalLinks
, true );
55 'backend' => 'local-backend',
56 'initialCapital' => false,