Move DatabaseDomain to Rdbms namespace
[mediawiki.git] / tests / phpunit / includes / filerepo / FileRepoTest.php
blobd1e6dc39ad39143b411412d93b45741f9f097dff
1 <?php
3 class FileRepoTest extends MediaWikiTestCase {
5 /**
6 * @expectedException MWException
7 * @covers FileRepo::__construct
8 */
9 public function testFileRepoConstructionOptionCanNotBeNull() {
10 new FileRepo();
13 /**
14 * @expectedException MWException
15 * @covers FileRepo::__construct
17 public function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
18 new FileRepo( [] );
21 /**
22 * @expectedException MWException
23 * @covers FileRepo::__construct
25 public function testFileRepoConstructionOptionNeedNameKey() {
26 new FileRepo( [
27 'backend' => 'foobar'
28 ] );
31 /**
32 * @expectedException MWException
33 * @covers FileRepo::__construct
35 public function testFileRepoConstructionOptionNeedBackendKey() {
36 new FileRepo( [
37 'name' => 'foobar'
38 ] );
41 /**
42 * @covers FileRepo::__construct
44 public function testFileRepoConstructionWithRequiredOptions() {
45 $f = new FileRepo( [
46 'name' => 'FileRepoTestRepository',
47 'backend' => new FSFileBackend( [
48 'name' => 'local-testing',
49 'wikiId' => 'test_wiki',
50 'containerPaths' => []
51 ] )
52 ] );
53 $this->assertInstanceOf( 'FileRepo', $f );