summaryrefslogtreecommitdiff
path: root/www/wiki/tests/phpunit/mocks/filerepo/MockLocalRepo.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/tests/phpunit/mocks/filerepo/MockLocalRepo.php')
-rw-r--r--www/wiki/tests/phpunit/mocks/filerepo/MockLocalRepo.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/www/wiki/tests/phpunit/mocks/filerepo/MockLocalRepo.php b/www/wiki/tests/phpunit/mocks/filerepo/MockLocalRepo.php
new file mode 100644
index 00000000..eeaf05a0
--- /dev/null
+++ b/www/wiki/tests/phpunit/mocks/filerepo/MockLocalRepo.php
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * Class simulating a local file repo.
+ *
+ * @ingroup FileRepo
+ * @since 1.28
+ */
+class MockLocalRepo extends LocalRepo {
+ function getLocalCopy( $virtualUrl ) {
+ return new MockFSFile( wfTempDir() . '/' . wfRandomString( 32 ) );
+ }
+
+ function getLocalReference( $virtualUrl ) {
+ return new MockFSFile( wfTempDir() . '/' . wfRandomString( 32 ) );
+ }
+
+ function getFileProps( $virtualUrl ) {
+ $fsFile = $this->getLocalReference( $virtualUrl );
+
+ return $fsFile->getProps();
+ }
+}