"$base/unittest-cont1/e/fileB.a",
"$base/unittest-cont1/e/fileC.a"
];
- $createOps = [];
- $purgeOps = [];
+ $createOps = $copyOps = $moveOps = $deleteOps = [];
foreach ( $files as $path ) {
$status = $this->prepare( [ 'dir' => dirname( $path ) ] );
$this->assertGoodStatus( $status,
$createOps[] = [ 'op' => 'create', 'dst' => $path, 'content' => mt_rand( 0, 50000 ) ];
$copyOps[] = [ 'op' => 'copy', 'src' => $path, 'dst' => "$path-2" ];
$moveOps[] = [ 'op' => 'move', 'src' => "$path-2", 'dst' => "$path-3" ];
- $purgeOps[] = [ 'op' => 'delete', 'src' => $path ];
- $purgeOps[] = [ 'op' => 'delete', 'src' => "$path-3" ];
+ $moveOps[] = [
+ 'op' => 'move',
+ 'src' => "$path-nothing",
+ 'dst' => "$path-nowhere",
+ 'ignoreMissingSource' => true
+ ];
+ $deleteOps[] = [ 'op' => 'delete', 'src' => $path ];
+ $deleteOps[] = [ 'op' => 'delete', 'src' => "$path-3" ];
+ $deleteOps[] = [
+ 'op' => 'delete',
+ 'src' => "$path-gone",
+ 'ignoreMissingSource' => true
+ ];
}
- $purgeOps[] = [ 'op' => 'null' ];
+ $deleteOps[] = [ 'op' => 'null' ];
$this->assertGoodStatus(
$this->backend->doQuickOperations( $createOps ),
"File {$files[0]} still exists." );
$this->assertGoodStatus(
- $this->backend->doQuickOperations( $purgeOps ),
+ $this->backend->doQuickOperations( $deleteOps ),
"Quick deletion of source files succeeded ($backendName)." );
foreach ( $files as $file ) {
$this->assertFalse( $this->backend->fileExists( [ 'src' => $file ] ),
$tmpFile = $this->backend->getLocalCopy( [
'src' => "$base/unittest-cont1/not-there" ] );
- $this->assertEquals( null, $tmpFile, "Local copy of not existing file is null ($backendName)." );
+ $this->assertNull( $tmpFile, "Local copy of not existing file is null ($backendName)." );
$tmpFile = $this->backend->getLocalReference( [
'src' => "$base/unittest-cont1/not-there" ] );
- $this->assertEquals( null, $tmpFile, "Local ref of not existing file is null ($backendName)." );
+ $this->assertNull( $tmpFile, "Local ref of not existing file is null ($backendName)." );
}
/**
"$base/subdir2/subdir/sub/120-px-file.txt",
];
- for ( $i = 0; $i < 25; $i++ ) {
+ for ( $i = 0; $i < 2; $i++ ) {
$status = $this->backend->lockFiles( $paths, LockManager::LOCK_EX );
$this->assertEquals( print_r( [], true ), print_r( $status->getErrors(), true ),
"Locking of files succeeded ($backendName) ($i)." );
"Scoped locking of files succeeded with OK status ($backendName)." );
ScopedLock::release( $sl );
- $this->assertEquals( null, $sl,
+ $this->assertNull( $sl,
"Scoped unlocking of files succeeded ($backendName)." );
$this->assertEquals( [], $status->getErrors(),
"Scoped unlocking of files succeeded ($backendName)." );
$be->getReadIndexFromParams( [ 'latest' => 1 ] ),
'Reads with "latest" flag use backend 1'
);
- $this->assertEquals(
+ $this->assertSame(
0,
$be->getReadIndexFromParams( [ 'latest' => 0 ] ),
'Reads without "latest" flag use backend 0'