aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/filebackend/FileBackendTest.php
diff options
context:
space:
mode:
authorAaron Schulz <aschulz@wikimedia.org>2016-09-18 17:22:36 -0700
committerAaron Schulz <aschulz@wikimedia.org>2016-09-19 19:55:09 +0000
commitf7e3ac3f95ce2b5a9f73326e854d1c301b513078 (patch)
treefe70905a0d7b96c6b1fa311808a0790bb6ad55fc /tests/phpunit/includes/filebackend/FileBackendTest.php
parent95eed85fb9c085cd2da8200335ec16640054e18f (diff)
downloadmediawikicore-f7e3ac3f95ce2b5a9f73326e854d1c301b513078.tar.gz
mediawikicore-f7e3ac3f95ce2b5a9f73326e854d1c301b513078.zip
FSFile and TempFSFile cleanups
* Remove wf* function dependencies. This includes wfTempDir(). Callers now should specify the directory, though it will try to do most of the wfTempDir() logic anyway if they do not. * Update callers to inject wfTempDir() so $wgTmpDirectory is used by TempFSFile instead of it probing to find a valid directory itself. * Move most of the wfTempDir() logic to TempFSFile::getUsableTempDirectory(). * Remove unused getMimeType() method. Change-Id: Idd55936b07f9448a6c90577708722b7b52b8fe66
Diffstat (limited to 'tests/phpunit/includes/filebackend/FileBackendTest.php')
-rw-r--r--tests/phpunit/includes/filebackend/FileBackendTest.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php
index 254cfbd6775e..ca562aa14f9c 100644
--- a/tests/phpunit/includes/filebackend/FileBackendTest.php
+++ b/tests/phpunit/includes/filebackend/FileBackendTest.php
@@ -268,7 +268,7 @@ class FileBackendTest extends MediaWikiTestCase {
public static function provider_testStore() {
$cases = [];
- $tmpName = TempFSFile::factory( "unittests_", 'txt' )->getPath();
+ $tmpName = TempFSFile::factory( "unittests_", 'txt', wfTempDir() )->getPath();
$toPath = self::baseStorePath() . '/unittest-cont1/e/fun/obj1.txt';
$op = [ 'op' => 'store', 'src' => $tmpName, 'dst' => $toPath ];
$cases[] = [ $op ];
@@ -1786,9 +1786,9 @@ class FileBackendTest extends MediaWikiTestCase {
$fileBContents = 'g-jmq3gpqgt3qtg q3GT ';
$fileCContents = 'eigna[ogmewt 3qt g3qg flew[ag';
- $tmpNameA = TempFSFile::factory( "unittests_", 'txt' )->getPath();
- $tmpNameB = TempFSFile::factory( "unittests_", 'txt' )->getPath();
- $tmpNameC = TempFSFile::factory( "unittests_", 'txt' )->getPath();
+ $tmpNameA = TempFSFile::factory( "unittests_", 'txt', wfTempDir() )->getPath();
+ $tmpNameB = TempFSFile::factory( "unittests_", 'txt', wfTempDir() )->getPath();
+ $tmpNameC = TempFSFile::factory( "unittests_", 'txt', wfTempDir() )->getPath();
$this->addTmpFiles( [ $tmpNameA, $tmpNameB, $tmpNameC ] );
file_put_contents( $tmpNameA, $fileAContents );
file_put_contents( $tmpNameB, $fileBContents );