wiki.techinc.nl/tests/phpunit/includes/filerepo/FileRepoTest.php
Kunal Mehta 6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00

55 lines
1.1 KiB
PHP

<?php
class FileRepoTest extends MediaWikiTestCase {
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionCanNotBeNull() {
new FileRepo();
}
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
new FileRepo( [] );
}
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionNeedNameKey() {
new FileRepo( [
'backend' => 'foobar'
] );
}
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionNeedBackendKey() {
new FileRepo( [
'name' => 'foobar'
] );
}
/**
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionWithRequiredOptions() {
$f = new FileRepo( [
'name' => 'FileRepoTestRepository',
'backend' => new FSFileBackend( [
'name' => 'local-testing',
'wikiId' => 'test_wiki',
'containerPaths' => []
] )
] );
$this->assertInstanceOf( 'FileRepo', $f );
}
}