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 ];
$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 );
// 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" );
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)." );
# # 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)." );
$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)." );
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)." );
}
}
- 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 );
}
}