X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Ffilebackend%2FFileBackendTest.php;h=c3d31d12221524d6da16e504d73ad7c1e1d178ca;hb=72b9240497311a2fa5f5b76d9e8bb953dc59853f;hp=254cfbd6775e88e7e9eb77aebf8a73349d7aa97d;hpb=3e9d53bfadb9f277ba488422479c28d3444a99fd;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php index 254cfbd677..c3d31d1222 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 ); @@ -1914,7 +1914,7 @@ class FileBackendTest extends MediaWikiTestCase { // 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 @@ class FileBackendTest extends MediaWikiTestCase { 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 @@ class FileBackendTest extends MediaWikiTestCase { # # 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 @@ class FileBackendTest extends MediaWikiTestCase { $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 @@ class FileBackendTest extends MediaWikiTestCase { 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 @@ class FileBackendTest extends MediaWikiTestCase { } } - 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 ); } }