Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbrink committed Dec 17, 2022
1 parent d3111aa commit 2d10a76
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions tests/Unit/Resources/FulfillmentInboundResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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');
Expand Down

0 comments on commit 2d10a76

Please sign in to comment.