wiki.techinc.nl/tests/phpunit/includes/filerepo/FileRepoTest.php
James D. Forrester 83d76f4cb5 phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass
Change-Id: I63f97497714a32236268be6965c5e181dade6c58
2019-10-14 12:48:48 -07:00

55 lines
1.2 KiB
PHP

<?php
class FileRepoTest extends MediaWikiTestCase {
/**
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionCanNotBeNull() {
$this->expectException( MWException::class );
new FileRepo();
}
/**
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
$this->expectException( MWException::class );
new FileRepo( [] );
}
/**
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionNeedNameKey() {
$this->expectException( MWException::class );
new FileRepo( [
'backend' => 'foobar'
] );
}
/**
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionNeedBackendKey() {
$this->expectException( MWException::class );
new FileRepo( [
'name' => 'foobar'
] );
}
/**
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionWithRequiredOptions() {
$f = new FileRepo( [
'name' => 'FileRepoTestRepository',
'backend' => new FSFileBackend( [
'name' => 'local-testing',
'wikiId' => 'test_wiki',
'containerPaths' => []
] )
] );
$this->assertInstanceOf( FileRepo::class, $f );
}
}