Merge "Blacklist Google Glass web browser from JS"
[mediawiki.git] / tests / phpunit / includes / filerepo / FileRepoTest.php
bloba196dca83b1f2d2edd1a871cc7cdc2d221ead272
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( array() );
21 /**
22 * @expectedException MWException
23 * @covers FileRepo::__construct
25 public function testFileRepoConstructionOptionNeedNameKey() {
26 new FileRepo( array(
27 'backend' => 'foobar'
28 ) );
31 /**
32 * @expectedException MWException
33 * @covers FileRepo::__construct
35 public function testFileRepoConstructionOptionNeedBackendKey() {
36 new FileRepo( array(
37 'name' => 'foobar'
38 ) );
41 /**
42 * @covers FileRepo::__construct
44 public function testFileRepoConstructionWithRequiredOptions() {
45 $f = new FileRepo( array(
46 'name' => 'FileRepoTestRepository',
47 'backend' => new FSFileBackend( array(
48 'name' => 'local-testing',
49 'wikiId' => 'test_wiki',
50 'containerPaths' => array()
51 ) )
52 ) );
53 $this->assertInstanceOf( 'FileRepo', $f );