From 35b703cbc72ba3db9140849cb44b52177a4d80e0 Mon Sep 17 00:00:00 2001 From: Jin Date: Sat, 4 Nov 2023 15:58:47 +0700 Subject: [PATCH] fix: unit test for upload api --- tests/Resources/FulfillmentTest.php | 4 ++-- tests/Resources/ProductTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Resources/FulfillmentTest.php b/tests/Resources/FulfillmentTest.php index 2c0bb44..7d31a3b 100644 --- a/tests/Resources/FulfillmentTest.php +++ b/tests/Resources/FulfillmentTest.php @@ -58,7 +58,7 @@ public function testCombinePackage() public function testFulfillmentUploadDeliveryFile() { - $this->caller->fulfillmentUploadDeliveryFile('file content'); + $this->caller->fulfillmentUploadDeliveryFile('php://memory'); $this->assertPreviousRequest('POST', 'fulfillment/'.TestResource::TEST_API_VERSION.'/files/upload'); } @@ -138,7 +138,7 @@ public function testUpdatePackageShippingInfo() public function testFulfillmentUploadDeliveryImage() { - $this->caller->fulfillmentUploadDeliveryImage('image content'); + $this->caller->fulfillmentUploadDeliveryImage('php://memory'); $this->assertPreviousRequest('POST', 'fulfillment/'.TestResource::TEST_API_VERSION.'/images/upload'); } diff --git a/tests/Resources/ProductTest.php b/tests/Resources/ProductTest.php index cbda6ce..3b35dcc 100644 --- a/tests/Resources/ProductTest.php +++ b/tests/Resources/ProductTest.php @@ -52,7 +52,7 @@ public function testGetAttributes() public function testUploadProductImage() { - $this->caller->uploadProductImage('image data'); + $this->caller->uploadProductImage('php://memory'); $this->assertPreviousRequest('POST', 'product/'.TestResource::TEST_API_VERSION.'/images/upload'); } @@ -64,7 +64,7 @@ public function testGetProduct() public function testUploadProductFile() { - $this->caller->uploadProductFile('file data'); + $this->caller->uploadProductFile('php://memory'); $this->assertPreviousRequest('POST', 'product/'.TestResource::TEST_API_VERSION.'/files/upload'); }