2012-01-23 14:50:54 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class FileRepoTest extends MediaWikiTestCase {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @expectedException MWException
|
|
|
|
|
*/
|
|
|
|
|
function testFileRepoConstructionOptionCanNotBeNull() {
|
|
|
|
|
$f = new FileRepo();
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* @expectedException MWException
|
|
|
|
|
*/
|
|
|
|
|
function testFileRepoConstructionOptionCanNotBeAnEmptyArray() {
|
|
|
|
|
$f = new FileRepo( array() );
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* @expectedException MWException
|
|
|
|
|
*/
|
|
|
|
|
function testFileRepoConstructionOptionNeedNameKey() {
|
|
|
|
|
$f = new FileRepo( array(
|
|
|
|
|
'backend' => 'foobar'
|
|
|
|
|
) );
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* @expectedException MWException
|
|
|
|
|
*/
|
|
|
|
|
function testFileRepoConstructionOptionNeedBackendKey() {
|
|
|
|
|
$f = new FileRepo( array(
|
|
|
|
|
'name' => 'foobar'
|
|
|
|
|
) );
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-07 14:54:06 +00:00
|
|
|
function testFileRepoConstructionWithRequiredOptions() {
|
|
|
|
|
$f = new FileRepo( array(
|
|
|
|
|
'name' => 'FileRepoTestRepository',
|
2012-03-13 01:44:39 +00:00
|
|
|
'backend' => new FSFileBackend( array(
|
|
|
|
|
'name' => 'local-testing',
|
|
|
|
|
'lockManager' => 'nullLockManager',
|
|
|
|
|
'containerPaths' => array()
|
|
|
|
|
) )
|
|
|
|
|
) );
|
2012-02-07 14:54:06 +00:00
|
|
|
$this->assertInstanceOf( 'FileRepo', $f );
|
|
|
|
|
}
|
2012-01-23 14:50:54 +00:00
|
|
|
}
|