Page MenuHomeWickedGov Phorge

FileRepoTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

FileRepoTest.php

<?php
use MediaWiki\MainConfigNames;
use Wikimedia\FileBackend\FSFileBackend;
/**
* @covers \FileRepo
*/
class FileRepoTest extends MediaWikiIntegrationTestCase {
public function testFileRepoConstructionOptionCanNotBeNull() {
$this->expectException( InvalidArgumentException::class );
new FileRepo();
}
public function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
$this->expectException( InvalidArgumentException::class );
new FileRepo( [] );
}
public function testFileRepoConstructionOptionNeedNameKey() {
$this->expectException( InvalidArgumentException::class );
new FileRepo( [
'backend' => 'foobar'
] );
}
public function testFileRepoConstructionOptionNeedBackendKey() {
$this->expectException( InvalidArgumentException::class );
new FileRepo( [
'name' => 'foobar'
] );
}
public function testFileRepoConstructionWithRequiredOptions() {
$f = new FileRepo( [
'name' => 'FileRepoTestRepository',
'backend' => new FSFileBackend( [
'name' => 'local-testing',
'wikiId' => 'test_wiki',
'containerPaths' => []
] )
] );
$this->assertInstanceOf( FileRepo::class, $f );
}
public function testFileRepoConstructionWithInvalidCasing() {
$this->expectException( InvalidArgumentException::class );
$this->expectExceptionMessage( 'File repos with initial capital false' );
$this->overrideConfigValue( MainConfigNames::CapitalLinks, true );
new FileRepo( [
'name' => 'foobar',
'backend' => 'local-backend',
'initialCapital' => false,
] );
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Jul 3, 20:48 (1 d, 6 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b7/7a/5d219a21a5fde42afae12d987106
Default Alt Text
FileRepoTest.php (1 KB)

Event Timeline