wiki.techinc.nl/tests/phpunit/includes/filerepo/FileRepoTest.php
addshore 4e941cf4ca Add @covers tags for more tests
Change-Id: Iff3af78e9b41c445b7f066b6c0d0f4a87d2d6c4e
2013-10-21 11:28:39 +02:00

55 lines
1.1 KiB
PHP

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