From 6183baf4939275dde8e089b5273d5a91f14fe042 Mon Sep 17 00:00:00 2001 From: lewzylu Date: Tue, 10 Mar 2020 11:56:31 +0800 Subject: [PATCH] fix bug of list parts --- src/Qcloud/Cos/Service.php | 2 +- src/Qcloud/Cos/Tests/Test.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Qcloud/Cos/Service.php b/src/Qcloud/Cos/Service.php index 69adbf4e..71e4c6b7 100644 --- a/src/Qcloud/Cos/Service.php +++ b/src/Qcloud/Cos/Service.php @@ -4243,7 +4243,7 @@ public static function getService() { 'Parts' => array( 'type' => 'array', 'location' => 'xml', - 'sentAs' => 'Parts', + 'sentAs' => 'Part', 'data' => array( 'xmlFlattened' => true ), diff --git a/src/Qcloud/Cos/Tests/Test.php b/src/Qcloud/Cos/Tests/Test.php index 52be9913..a4582cb1 100644 --- a/src/Qcloud/Cos/Tests/Test.php +++ b/src/Qcloud/Cos/Tests/Test.php @@ -1132,6 +1132,10 @@ public function testResumeUpload() { 'Body' => substr($body, 0, $partSize), 'UploadId' => $uploadId, 'PartNumber' => 1]); + $rt = $this->cosClient->ListParts(['Bucket' => $this->bucket, + 'Key' => $key, + 'UploadId' => $uploadId]); + $this->assertEquals(count($rt['Parts']), 1); $this->cosClient->resumeUpload($bucket=$this->bucket, $key=$key, $body=$body,