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) {
9292 'PartNumberMarker ' => $ marker ,
9393 'MaxParts ' => 1000 ,
9494 '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+ }
99101 }
100102 $ marker = $ rt ['NextPartNumberMarker ' ];
101103 if (!$ rt ['IsTruncated ' ]) {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ protected function setUp()
1717 'appId ' => getenv ('COS_APPID ' ),
1818 'secretId ' => getenv ('COS_KEY ' ),
1919 'secretKey ' => getenv ('COS_SECRET ' ))));
20- sleep (10 );
20+ sleep (5 );
2121 }
2222
2323 protected function tearDown ()
@@ -789,9 +789,9 @@ public function testCopyBigFile()
789789 $ this ->cosClient ->Copy ($ bucket = $ this ->bucket ,
790790 $ key = 'test10G ' ,
791791 $ 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 );
795795
796796 } catch (ServiceResponseException $ e ) {
797797 $ this ->assertFalse (true , $ e );
You can’t perform that action at this time.
0 commit comments