Merge "Add line breaks to the output of action=info"
[lhc/web/wiklou.git] / tests / phpunit / includes / filerepo / FileRepoTest.php
1 <?php
2
3 class FileRepoTest extends MediaWikiTestCase {
4
5 /**
6 * @expectedException MWException
7 */
8 function testFileRepoConstructionOptionCanNotBeNull() {
9 $f = new FileRepo();
10 }
11
12 /**
13 * @expectedException MWException
14 */
15 function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
16 $f = new FileRepo( array() );
17 }
18
19 /**
20 * @expectedException MWException
21 */
22 function testFileRepoConstructionOptionNeedNameKey() {
23 $f = new FileRepo( array(
24 'backend' => 'foobar'
25 ) );
26 }
27
28 /**
29 * @expectedException MWException
30 */
31 function testFileRepoConstructionOptionNeedBackendKey() {
32 $f = new FileRepo( array(
33 'name' => 'foobar'
34 ) );
35 }
36
37 function testFileRepoConstructionWithRequiredOptions() {
38 $f = new FileRepo( array(
39 'name' => 'FileRepoTestRepository',
40 'backend' => new FSFileBackend( array(
41 'name' => 'local-testing',
42 'lockManager' => 'nullLockManager',
43 'containerPaths' => array()
44 ) )
45 ) );
46 $this->assertInstanceOf( 'FileRepo', $f );
47 }
48 }