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