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()
83
83
public function testCopy ()
84
84
{
85
85
$ key = 'copyto ' . rand ();
86
+ $ this ->bucketManager ->delete ($ this ->bucketName , $ key );
87
+
86
88
$ error = $ this ->bucketManager ->copy (
87
89
$ this ->bucketName ,
88
90
$ this ->key ,
89
91
$ this ->bucketName ,
90
92
$ key
91
93
);
92
94
$ 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
+
93
110
$ error = $ this ->bucketManager ->delete ($ this ->bucketName , $ key );
94
111
$ this ->assertNull ($ error );
95
112
}
Original file line number Diff line number Diff line change 9
9
$ testAuth = new Auth ($ accessKey , $ secretKey );
10
10
$ bucketName = 'phpsdk ' ;
11
11
$ key = 'php-logo.png ' ;
12
+ $ key2 = 'niu.png ' ;
12
13
$ bucketNameBC = 'phpsdk-bc ' ;
13
14
14
15
$ dummyAccessKey = 'abcdefghklmnopq ' ;
You can’t perform that action at this time.
0 commit comments