From: jenkins-bot Date: Tue, 20 Sep 2016 23:21:30 +0000 (+0000) Subject: Merge "FSFile and TempFSFile cleanups" X-Git-Tag: 1.31.0-rc.0~5439 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=8afc7161ed70ed38ec3dbbae1f42810e36b413e6;hp=-c;p=lhc%2Fweb%2Fwiklou.git Merge "FSFile and TempFSFile cleanups" --- 8afc7161ed70ed38ec3dbbae1f42810e36b413e6 diff --combined tests/phpunit/includes/filebackend/FileBackendTest.php index d023b32d5f,ca562aa14f..c3d31d1222 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendTest.php @@@ -268,7 -268,7 +268,7 @@@ class FileBackendTest extends MediaWiki 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 +1786,9 @@@ $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 ); @@@ -1914,7 -1914,7 +1914,7 @@@ // Does nothing ], [ 'force' => 1 ] ); - $this->assertNotEquals( [], $status->errors, "Operation had warnings" ); + $this->assertNotEquals( [], $status->getErrors(), "Operation had warnings" ); $this->assertEquals( true, $status->isOK(), "Operation batch succeeded" ); $this->assertEquals( 8, count( $status->success ), "Operation batch has correct success array" ); @@@ -2371,25 -2371,25 +2371,25 @@@ for ( $i = 0; $i < 25; $i++ ) { $status = $this->backend->lockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( [], true ), print_r( $status->errors, true ), + $this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ), "Locking of files succeeded ($backendName) ($i)." ); $this->assertEquals( true, $status->isOK(), "Locking of files succeeded with OK status ($backendName) ($i)." ); $status = $this->backend->lockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( [], true ), print_r( $status->errors, true ), + $this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ), "Locking of files succeeded ($backendName) ($i)." ); $this->assertEquals( true, $status->isOK(), "Locking of files succeeded with OK status ($backendName) ($i)." ); $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( [], true ), print_r( $status->errors, true ), + $this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ), "Locking of files succeeded ($backendName) ($i)." ); $this->assertEquals( true, $status->isOK(), "Locking of files succeeded with OK status ($backendName) ($i)." ); $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( [], true ), print_r( $status->errors, true ), + $this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ), "Locking of files succeeded ($backendName). ($i)" ); $this->assertEquals( true, $status->isOK(), "Locking of files succeeded with OK status ($backendName) ($i)." ); @@@ -2397,25 -2397,25 +2397,25 @@@ # # Flip the acquire/release ordering around ## $status = $this->backend->lockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( [], true ), print_r( $status->errors, true ), + $this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ), "Locking of files succeeded ($backendName) ($i)." ); $this->assertEquals( true, $status->isOK(), "Locking of files succeeded with OK status ($backendName) ($i)." ); $status = $this->backend->lockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( [], true ), print_r( $status->errors, true ), + $this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ), "Locking of files succeeded ($backendName) ($i)." ); $this->assertEquals( true, $status->isOK(), "Locking of files succeeded with OK status ($backendName) ($i)." ); $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( [], true ), print_r( $status->errors, true ), + $this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ), "Locking of files succeeded ($backendName). ($i)" ); $this->assertEquals( true, $status->isOK(), "Locking of files succeeded with OK status ($backendName) ($i)." ); $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( [], true ), print_r( $status->errors, true ), + $this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ), "Locking of files succeeded ($backendName) ($i)." ); $this->assertEquals( true, $status->isOK(), "Locking of files succeeded with OK status ($backendName) ($i)." ); @@@ -2425,7 -2425,7 +2425,7 @@@ $sl = $this->backend->getScopedFileLocks( $paths, LockManager::LOCK_EX, $status ); $this->assertInstanceOf( 'ScopedLock', $sl, "Scoped locking of files succeeded ($backendName)." ); - $this->assertEquals( [], $status->errors, + $this->assertEquals( [], $status->getErrors(), "Scoped locking of files succeeded ($backendName)." ); $this->assertEquals( true, $status->isOK(), "Scoped locking of files succeeded with OK status ($backendName)." ); @@@ -2433,7 -2433,7 +2433,7 @@@ ScopedLock::release( $sl ); $this->assertEquals( null, $sl, "Scoped unlocking of files succeeded ($backendName)." ); - $this->assertEquals( [], $status->errors, + $this->assertEquals( [], $status->getErrors(), "Scoped unlocking of files succeeded ($backendName)." ); $this->assertEquals( true, $status->isOK(), "Scoped unlocking of files succeeded with OK status ($backendName)." ); @@@ -2647,7 -2647,7 +2647,7 @@@ } } - function assertGoodStatus( $status, $msg ) { - $this->assertEquals( print_r( [], 1 ), print_r( $status->errors, 1 ), $msg ); + function assertGoodStatus( StatusValue $status, $msg ) { + $this->assertEquals( print_r( [], 1 ), print_r( $status->getErrors(), 1 ), $msg ); } }