예제 #1
0
 public function testBatchDeleteMoveCopy()
 {
     $key2 = 'testOp2' . getTid();
     $key3 = 'testOp3' . getTid();
     $key4 = 'testOp4' . getTid();
     $e1 = new QiniuRSEntryPath($this->bucket, $this->key);
     $e2 = new QiniuRSEntryPath($this->bucket, $key2);
     $e3 = new QiniuRSEntryPath($this->bucket, $key3);
     $e4 = new QiniuRSEntryPath($this->bucket, $key4);
     RSUtils::Qiniu_RS_BatchDelete($this->client, array($e2, $e3, $e4));
     $entryPairs = array(new QiniuRSEntryPathPair($e1, $e2), new QiniuRSEntryPathPair($e1, $e3));
     list($ret, $err) = RSUtils::Qiniu_RS_BatchCopy($this->client, $entryPairs);
     $this->assertNull($err);
     $this->assertEquals($ret[0]['code'], 200);
     $this->assertEquals($ret[1]['code'], 200);
     list($ret, $err) = RSUtils::Qiniu_RS_BatchMove($this->client, array(new QiniuRSEntryPathPair($e2, $e4)));
     $this->assertNull($err);
     $this->assertEquals($ret[0]['code'], 200);
     list($ret, $err) = RSUtils::Qiniu_RS_BatchDelete($this->client, array($e3, $e4));
     $this->assertNull($err);
     $this->assertEquals($ret[0]['code'], 200);
     $this->assertEquals($ret[1]['code'], 200);
     RSUtils::Qiniu_RS_BatchDelete($this->client, array($e2, $e3, $e4));
 }