wiki.techinc.nl/tests/phpunit/includes/filerepo/FileRepoTest.php

56 lines
1.2 KiB
PHP
Raw Normal View History

<?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( array() );
}
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionNeedNameKey() {
new FileRepo( array(
'backend' => 'foobar'
) );
}
/**
* @expectedException MWException
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionOptionNeedBackendKey() {
new FileRepo( array(
'name' => 'foobar'
) );
}
/**
* @covers FileRepo::__construct
*/
public function testFileRepoConstructionWithRequiredOptions() {
2012-02-07 14:54:06 +00:00
$f = new FileRepo( array(
'name' => 'FileRepoTestRepository',
'backend' => new FSFileBackend( array(
'name' => 'local-testing',
'lockManager' => 'nullLockManager',
'containerPaths' => array()
) )
) );
2012-02-07 14:54:06 +00:00
$this->assertInstanceOf( 'FileRepo', $f );
}
}