File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -83,13 +83,30 @@ public function testRename()
8383 public function testCopy ()
8484 {
8585 $ key = 'copyto ' . rand ();
86+ $ this ->bucketManager ->delete ($ this ->bucketName , $ key );
87+
8688 $ error = $ this ->bucketManager ->copy (
8789 $ this ->bucketName ,
8890 $ this ->key ,
8991 $ this ->bucketName ,
9092 $ key
9193 );
9294 $ this ->assertNull ($ error );
95+
96+ //test force copy
97+ $ error = $ this ->bucketManager ->copy (
98+ $ this ->bucketName ,
99+ $ this ->key2 ,
100+ $ this ->bucketName ,
101+ $ key ,
102+ true
103+ );
104+ $ this ->assertNull ($ error );
105+
106+ $ key2Stat = $ this ->bucketManager ->stat ($ this ->bucketName , $ this ->key2 );
107+ $ key2CopiedStat = $ this ->bucketManager ->stat ($ this ->bucketName , $ key );
108+ $ this ->assertEquals ($ key2Stat ['hash ' ], $ key2CopiedStat ['hash ' ]);
109+
93110 $ error = $ this ->bucketManager ->delete ($ this ->bucketName , $ key );
94111 $ this ->assertNull ($ error );
95112 }
Original file line number Diff line number Diff line change 99$ testAuth = new Auth ($ accessKey , $ secretKey );
1010$ bucketName = 'phpsdk ' ;
1111$ key = 'php-logo.png ' ;
12+ $ key2 = 'niu.png ' ;
1213$ bucketNameBC = 'phpsdk-bc ' ;
1314
1415$ dummyAccessKey = 'abcdefghklmnopq ' ;
You can’t perform that action at this time.
0 commit comments