Added merge() function to BagOStuff for CAS-like functionality.
[mediawiki.git] / tests / phpunit / includes / filerepo / FileRepoTest.php
blob8f92c123e6f5a705f2f514b0b617f0ad2fad174e
1 <?php
3 class FileRepoTest extends MediaWikiTestCase {
5 /**
6 * @expectedException MWException
7 */
8 function testFileRepoConstructionOptionCanNotBeNull() {
9 $f = new FileRepo();
11 /**
12 * @expectedException MWException
14 function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
15 $f = new FileRepo( array() );
17 /**
18 * @expectedException MWException
20 function testFileRepoConstructionOptionNeedNameKey() {
21 $f = new FileRepo( array(
22 'backend' => 'foobar'
23 ) );
25 /**
26 * @expectedException MWException
28 function testFileRepoConstructionOptionNeedBackendKey() {
29 $f = new FileRepo( array(
30 'name' => 'foobar'
31 ) );
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 );