@@ -43,5 +43,45 @@ public function testDeleteMoveCopy()
4343 $ err = Qiniu_RS_Delete ($ this ->client , $ this ->bucket , $ key2 );
4444 $ this ->assertNotNull ($ err , "delete key2 false " );
4545 }
46+
47+ public function testBatchStat ()
48+ {
49+ $ key2 = 'testOp2 ' . getTid ();
50+ Qiniu_RS_Delete ($ this ->client , $ this ->bucket , $ key2 );
51+ $ entries = array (new Qiniu_RS_EntryPath ($ this ->bucket , $ this ->key ), new Qiniu_RS_EntryPath ($ this ->bucket , $ key2 ));
52+ list ($ ret , $ err ) = Qiniu_RS_BatchStat ($ this ->client , $ entries );
53+ $ this ->assertNotNull ($ err );
54+ $ this ->assertEquals ($ ret [0 ]['code ' ], 200 );
55+ $ this ->assertEquals ($ ret [1 ]['code ' ], 612 );
56+ }
57+
58+ public function testBatchDeleteMoveCopy ()
59+ {
60+ $ key2 = 'testOp2 ' . getTid ();
61+ $ key3 = 'testOp3 ' . getTid ();
62+ $ key4 = 'testOp4 ' . getTid ();
63+ $ e1 = new Qiniu_RS_EntryPath ($ this ->bucket , $ this ->key );
64+ $ e2 = new Qiniu_RS_EntryPath ($ this ->bucket , $ key2 );
65+ $ e3 = new Qiniu_RS_EntryPath ($ this ->bucket , $ key3 );
66+ $ e4 = new Qiniu_RS_EntryPath ($ this ->bucket , $ key4 );
67+ Qiniu_RS_BatchDelete ($ this ->client , array ($ e2 , $ e3 ,$ e4 ));
68+
69+ $ entryPairs = array (new Qiniu_RS_EntryPathPair ($ e1 , $ e2 ), new Qiniu_RS_EntryPathPair ($ e1 , $ e3 ));
70+ list ($ ret , $ err ) = Qiniu_RS_BatchCopy ($ this ->client , $ entryPairs );
71+ $ this ->assertNull ($ err );
72+ $ this ->assertEquals ($ ret [0 ]['code ' ], 200 );
73+ $ this ->assertEquals ($ ret [1 ]['code ' ], 200 );
74+
75+ list ($ ret , $ err ) = Qiniu_RS_BatchMove ($ this ->client , array (new Qiniu_RS_EntryPathPair ($ e2 , $ e4 )));
76+ $ this ->assertNull ($ err );
77+ $ this ->assertEquals ($ ret [0 ]['code ' ], 200 );
78+
79+ list ($ ret , $ err ) = Qiniu_RS_BatchDelete ($ this ->client , array ($ e3 , $ e4 ));
80+ $ this ->assertNull ($ err );
81+ $ this ->assertEquals ($ ret [0 ]['code ' ], 200 );
82+ $ this ->assertEquals ($ ret [1 ]['code ' ], 200 );
83+
84+ Qiniu_RS_BatchDelete ($ this ->client , array ($ e2 , $ e3 , $ e4 ));
85+ }
4686}
4787
0 commit comments