summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/filerepo/FileRepoTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-09-04 05:51:59 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-09-04 05:51:59 +0200
commit91e194556c52d2f354344f930419eef2dd6267f0 (patch)
tree0cd12490d3cd3499274017c9b799d0f738d3719e /tests/phpunit/includes/filerepo/FileRepoTest.php
parent08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (diff)
Update to MediaWiki 1.21.2
Diffstat (limited to 'tests/phpunit/includes/filerepo/FileRepoTest.php')
-rw-r--r--tests/phpunit/includes/filerepo/FileRepoTest.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/phpunit/includes/filerepo/FileRepoTest.php b/tests/phpunit/includes/filerepo/FileRepoTest.php
new file mode 100644
index 00000000..7cc25b1b
--- /dev/null
+++ b/tests/phpunit/includes/filerepo/FileRepoTest.php
@@ -0,0 +1,48 @@
+<?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'
+ ) );
+ }
+
+ function testFileRepoConstructionWithRequiredOptions() {
+ $f = new FileRepo( array(
+ 'name' => 'FileRepoTestRepository',
+ 'backend' => new FSFileBackend( array(
+ 'name' => 'local-testing',
+ 'lockManager' => 'nullLockManager',
+ 'containerPaths' => array()
+ ) )
+ ) );
+ $this->assertInstanceOf( 'FileRepo', $f );
+ }
+}