File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -92,10 +92,12 @@ public function uploadParts($uploadId) {
92
92
'PartNumberMarker ' => $ marker ,
93
93
'MaxParts ' => 1000 ,
94
94
'UploadId ' => $ uploadId ));
95
- foreach ($ rt ['Parts ' ] as $ part ) {
96
- $ part = array ('PartNumber ' => $ finishedNum , 'ETag ' => $ part ['ETag ' ]);
97
- $ this ->parts [$ finishedNum ] = $ part ;
98
- $ finishedNum ++;
95
+ if (!empty ($ rt ['Parts ' ])) {
96
+ foreach ($ rt ['Parts ' ] as $ part ) {
97
+ $ part = array ('PartNumber ' => $ finishedNum , 'ETag ' => $ part ['ETag ' ]);
98
+ $ this ->parts [$ finishedNum ] = $ part ;
99
+ $ finishedNum ++;
100
+ }
99
101
}
100
102
$ marker = $ rt ['NextPartNumberMarker ' ];
101
103
if (!$ rt ['IsTruncated ' ]) {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ protected function setUp()
17
17
'appId ' => getenv ('COS_APPID ' ),
18
18
'secretId ' => getenv ('COS_KEY ' ),
19
19
'secretKey ' => getenv ('COS_SECRET ' ))));
20
- sleep (10 );
20
+ sleep (5 );
21
21
}
22
22
23
23
protected function tearDown ()
@@ -789,9 +789,9 @@ public function testCopyBigFile()
789
789
$ this ->cosClient ->Copy ($ bucket = $ this ->bucket ,
790
790
$ key = 'test10G ' ,
791
791
$ copysource = 'lewzylu01-1251668577.cos.ap-guangzhou.myqcloud.com/test10G ' );
792
- $ rt = $ this ->cosClient ->headObject ($ bucket = $ this ->bucket ,
793
- $ key = 'test10G ' );
794
- assertTrue (true , $ rt ['ContentLength ' ] == 1024 * 1024 * 1024 );
792
+ $ rt = $ this ->cosClient ->headObject (array ( ' Bucket ' => $ this ->$ bucket ,
793
+ ' Key ' => 'test10G ' ) );
794
+ assertTrue (true , $ rt ['ContentLength ' ] == 10485760000 );
795
795
796
796
} catch (ServiceResponseException $ e ) {
797
797
$ this ->assertFalse (true , $ e );
You can’t perform that action at this time.
0 commit comments