summaryrefslogtreecommitdiff
path: root/www/wiki/tests/phpunit/mocks/filerepo/MockLocalRepo.php
blob: eeaf05a0aae866eca158b54d1599b39cbc76b9ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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();
	}
}