From 2d10a76b7917ff9113e6f7d631447fea81f947fe Mon Sep 17 00:00:00 2001 From: Keith Brink Date: Sat, 17 Dec 2022 13:29:59 -0500 Subject: [PATCH] Fix test --- .../FulfillmentInboundResourceTest.php | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/Unit/Resources/FulfillmentInboundResourceTest.php b/tests/Unit/Resources/FulfillmentInboundResourceTest.php index 014f7886..07660654 100644 --- a/tests/Unit/Resources/FulfillmentInboundResourceTest.php +++ b/tests/Unit/Resources/FulfillmentInboundResourceTest.php @@ -191,11 +191,10 @@ public function testGetPrepInstructions() list($config, $http) = $this->setupConfigWithFakeHttp('fulfillment-inbound/get-prep-instructions'); $sku = Str::random(); - $sku_with_comma = 'Body Fat Measuring Tape, Pack of 2'; // This will be excluded because it contains a comma, impossible to handle $amzn = new AmznSPA($config); $amzn = $amzn->usingMarketplace('ATVPDKIKX0DER'); - $response = $amzn->fulfillment_inbound->getPrepInstructions('US', [$sku, $sku_with_comma]); + $response = $amzn->fulfillment_inbound->getPrepInstructions('US', [$sku]); $this->assertInstanceOf(GetPrepInstructionsResponse::class, $response); @@ -207,6 +206,26 @@ public function testGetPrepInstructions() }); } + public function testGetPrepInstructionsWithComma() + { + list($config, $http) = $this->setupConfigWithFakeHttp('fulfillment-inbound/get-prep-instructions'); + + $sku = 'Body Fat Measuring Tape, Pack of 2'; + + $amzn = new AmznSPA($config); + $amzn = $amzn->usingMarketplace('ATVPDKIKX0DER'); + $response = $amzn->fulfillment_inbound->getPrepInstructions('US', [$sku]); + + $this->assertInstanceOf(GetPrepInstructionsResponse::class, $response); + + $http->assertSent(function (Request $request) use ($sku) { + $this->assertEquals('GET', $request->method()); + $this->assertEquals('https://sellingpartnerapi-na.amazon.com/fba/inbound/v0/prepInstructions?ShipToCountryCode=US&SellerSKUList=Body%20Fat%20Measuring%20Tape%2C%20Pack%20of%202', $request->url()); + + return true; + }); + } + public function testGetTransportDetails() { list($config, $http) = $this->setupConfigWithFakeHttp('fulfillment-inbound/get-transport-details');