Tweak testFileRepoConstructionWithRequiredOptions so that it doesn't fail depending...
[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 * @expectedException MWException
13 */
14 function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
15 $f = new FileRepo( array() );
16 }
17 /**
18 * @expectedException MWException
19 */
20 function testFileRepoConstructionOptionNeedNameKey() {
21 $f = new FileRepo( array(
22 'backend' => 'foobar'
23 ) );
24 }
25 /**
26 * @expectedException MWException
27 */
28 function testFileRepoConstructionOptionNeedBackendKey() {
29 $f = new FileRepo( array(
30 'name' => 'foobar'
31 ) );
32 }
33
34 function testFileRepoConstructionWithRequiredOptions() {
35 $f = new FileRepo( array(
36 'name' => 'FileRepoTestRepository',
37 'backend' => new FSFileBackend( array(
38 'name' => 'local-testing',
39 'lockManager' => 'nullLockManager',
40 'containerPaths' => array()
41 ) )
42 ) );
43 $this->assertInstanceOf( 'FileRepo', $f );
44 }
45 }