wiki.techinc.nl/tests/phpunit/includes/filerepo/FileRepoTest.php
Umherirrender 45da581551 Use ::class to resolve class names in tests
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
2018-01-26 22:49:13 +01:00

55 lines
1.1 KiB
PHP

<?php
class FileRepoTest extends MediaWikiTestCase {
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionCanNotBeNull() {
new FileRepo();
}
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
new FileRepo( [] );
}
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionNeedNameKey() {
new FileRepo( [
'backend' => 'foobar'
] );
}
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionNeedBackendKey() {
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 );
}
}