-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Request Report Response Parser
- Loading branch information
tim hall
committed
Dec 16, 2020
1 parent
774e39f
commit 8786cec
Showing
6 changed files
with
122 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
C:37:"PHPUnit\Runner\DefaultTestResultCache":4998:{a:2:{s:7:"defects";a:5:{s:85:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_response";i:4;s:96:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_image_response";i:4;s:104:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_early_reviewer_rewards";i:4;s:76:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_use_dom_html";i:4;s:85:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_bug";i:3;}s:5:"times";a:36:{s:122:"EolabsIo\AmazonMwsClient\Tests\AmazonMwsResponseParserTest::it_throws_an_exception_if_an_invalid_response_type_is_provided";d:0.032;s:83:"EolabsIo\AmazonMwsClient\Tests\ErrorResponseParserTest::it_can_parse_error_response";d:0.005;s:95:"EolabsIo\AmazonMwsClient\Tests\GetMatchingProductResponseParserTest::it_can_get_result_accessor";d:0.003;s:111:"EolabsIo\AmazonMwsClient\Tests\GetMatchingProductResponseParserTest::it_can_parse_get_matching_product_response";d:0.003;s:112:"EolabsIo\AmazonMwsClient\Tests\GetMatchingProductResponseParserTest::it_can_parse_get_matching_products_response";d:0.004;s:119:"EolabsIo\AmazonMwsClient\Tests\InventoryServiceStatusResponseParserTest::it_can_parse_inventory_service_status_response";d:0.004;s:112:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventGroupsByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.005;s:143:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventGroupsByNextTokenResponseParserTest::it_can_parse_list_inventory_supply_by_next_token_response";d:0.004;s:101:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventGroupsResponseParserTest::it_can_get_result_accessor";d:0.004;s:107:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventGroupsResponseParserTest::it_can_parse_order_list_response";d:0.004;s:107:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventsByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.004;s:138:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventsByNextTokenResponseParserTest::it_can_parse_list_financial_events_by_next_token_response";d:0.003;s:96:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventsResponseParserTest::it_can_get_result_accessor";d:0.015;s:113:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventsResponseParserTest::it_can_parse_financial_events_list_response";d:0.01;s:107:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.006;s:138:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyByNextTokenResponseParserTest::it_can_parse_list_inventory_supply_by_next_token_response";d:0.004;s:96:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyResponseParserTest::it_can_get_result_accessor";d:0.005;s:113:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyResponseParserTest::it_can_parse_list_inventory_supply_response";d:0.004;s:124:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyResponseParserTest::it_can_parse_list_inventory_supply_with_token_response";d:0.003;s:106:"EolabsIo\AmazonMwsClient\Tests\ListMarketplaceParticipationsResponseParserTest::it_can_get_result_accessor";d:0.005;s:142:"EolabsIo\AmazonMwsClient\Tests\ListMarketplaceParticipationsResponseParserTest::it_can_parse_list_marketplace_participations_response_response";d:0.004;s:102:"EolabsIo\AmazonMwsClient\Tests\ListOrderItemsByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.005;s:123:"EolabsIo\AmazonMwsClient\Tests\ListOrderItemsByNextTokenResponseParserTest::it_can_parse_list_orders_by_next_token_response";d:0.004;s:91:"EolabsIo\AmazonMwsClient\Tests\ListOrderItemsResponseParserTest::it_can_get_result_accessor";d:0.004;s:97:"EolabsIo\AmazonMwsClient\Tests\ListOrderItemsResponseParserTest::it_can_parse_order_item_response";d:0.004;s:98:"EolabsIo\AmazonMwsClient\Tests\ListOrdersByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.005;s:119:"EolabsIo\AmazonMwsClient\Tests\ListOrdersByNextTokenResponseParserTest::it_can_parse_list_orders_by_next_token_response";d:0.004;s:87:"EolabsIo\AmazonMwsClient\Tests\ListOrdersResponseParserTest::it_can_get_result_accessor";d:0.005;s:93:"EolabsIo\AmazonMwsClient\Tests\ListOrdersResponseParserTest::it_can_parse_order_list_response";d:0.004;s:110:"EolabsIo\AmazonMwsClient\Tests\ListOrdersResponseParserTest::it_can_parse_order_list_removes_elements_response";d:0.004;s:85:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_response";d:0.419;s:98:"EolabsIo\AmazonMwsClient\Tests\ReviewRatingResponseParserTest::it_can_parse_review_rating_response";d:0.179;s:96:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_image_response";d:0.021;s:104:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_early_reviewer_rewards";d:0.367;s:76:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_use_dom_html";d:0.051;s:85:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_bug";d:0.025;}}} | ||
C:37:"PHPUnit\Runner\DefaultTestResultCache":5323:{a:2:{s:7:"defects";a:6:{s:85:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_response";i:4;s:96:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_image_response";i:4;s:104:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_early_reviewer_rewards";i:4;s:76:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_use_dom_html";i:4;s:85:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_bug";i:3;s:96:"EolabsIo\AmazonMwsClient\Tests\RequestReportResponseParserTest::it_can_parse_order_list_response";i:4;}s:5:"times";a:38:{s:122:"EolabsIo\AmazonMwsClient\Tests\AmazonMwsResponseParserTest::it_throws_an_exception_if_an_invalid_response_type_is_provided";d:0.037;s:83:"EolabsIo\AmazonMwsClient\Tests\ErrorResponseParserTest::it_can_parse_error_response";d:0.006;s:95:"EolabsIo\AmazonMwsClient\Tests\GetMatchingProductResponseParserTest::it_can_get_result_accessor";d:0.004;s:111:"EolabsIo\AmazonMwsClient\Tests\GetMatchingProductResponseParserTest::it_can_parse_get_matching_product_response";d:0.004;s:112:"EolabsIo\AmazonMwsClient\Tests\GetMatchingProductResponseParserTest::it_can_parse_get_matching_products_response";d:0.004;s:119:"EolabsIo\AmazonMwsClient\Tests\InventoryServiceStatusResponseParserTest::it_can_parse_inventory_service_status_response";d:0.005;s:112:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventGroupsByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.005;s:143:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventGroupsByNextTokenResponseParserTest::it_can_parse_list_inventory_supply_by_next_token_response";d:0.004;s:101:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventGroupsResponseParserTest::it_can_get_result_accessor";d:0.006;s:107:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventGroupsResponseParserTest::it_can_parse_order_list_response";d:0.003;s:107:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventsByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.006;s:138:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventsByNextTokenResponseParserTest::it_can_parse_list_financial_events_by_next_token_response";d:0.003;s:96:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventsResponseParserTest::it_can_get_result_accessor";d:0.016;s:113:"EolabsIo\AmazonMwsClient\Tests\ListFinancialEventsResponseParserTest::it_can_parse_financial_events_list_response";d:0.01;s:107:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.005;s:138:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyByNextTokenResponseParserTest::it_can_parse_list_inventory_supply_by_next_token_response";d:0.003;s:96:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyResponseParserTest::it_can_get_result_accessor";d:0.005;s:113:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyResponseParserTest::it_can_parse_list_inventory_supply_response";d:0.004;s:124:"EolabsIo\AmazonMwsClient\Tests\ListInventorySupplyResponseParserTest::it_can_parse_list_inventory_supply_with_token_response";d:0.004;s:106:"EolabsIo\AmazonMwsClient\Tests\ListMarketplaceParticipationsResponseParserTest::it_can_get_result_accessor";d:0.006;s:142:"EolabsIo\AmazonMwsClient\Tests\ListMarketplaceParticipationsResponseParserTest::it_can_parse_list_marketplace_participations_response_response";d:0.004;s:102:"EolabsIo\AmazonMwsClient\Tests\ListOrderItemsByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.004;s:123:"EolabsIo\AmazonMwsClient\Tests\ListOrderItemsByNextTokenResponseParserTest::it_can_parse_list_orders_by_next_token_response";d:0.003;s:91:"EolabsIo\AmazonMwsClient\Tests\ListOrderItemsResponseParserTest::it_can_get_result_accessor";d:0.005;s:97:"EolabsIo\AmazonMwsClient\Tests\ListOrderItemsResponseParserTest::it_can_parse_order_item_response";d:0.004;s:98:"EolabsIo\AmazonMwsClient\Tests\ListOrdersByNextTokenResponseParserTest::it_can_get_result_accessor";d:0.004;s:119:"EolabsIo\AmazonMwsClient\Tests\ListOrdersByNextTokenResponseParserTest::it_can_parse_list_orders_by_next_token_response";d:0.003;s:87:"EolabsIo\AmazonMwsClient\Tests\ListOrdersResponseParserTest::it_can_get_result_accessor";d:0.006;s:93:"EolabsIo\AmazonMwsClient\Tests\ListOrdersResponseParserTest::it_can_parse_order_list_response";d:0.004;s:110:"EolabsIo\AmazonMwsClient\Tests\ListOrdersResponseParserTest::it_can_parse_order_list_removes_elements_response";d:0.004;s:85:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_response";d:0.452;s:98:"EolabsIo\AmazonMwsClient\Tests\ReviewRatingResponseParserTest::it_can_parse_review_rating_response";d:0.183;s:96:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_image_response";d:0.03;s:104:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_early_reviewer_rewards";d:0.365;s:76:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_use_dom_html";d:0.051;s:85:"EolabsIo\AmazonMwsClient\Tests\ReviewResponseParserTest::it_can_parse_review_with_bug";d:0.035;s:90:"EolabsIo\AmazonMwsClient\Tests\RequestReportResponseParserTest::it_can_get_result_accessor";d:0.004;s:96:"EolabsIo\AmazonMwsClient\Tests\RequestReportResponseParserTest::it_can_parse_order_list_response";d:0.003;}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace EolabsIo\AmazonMwsResponseParser\Parsers; | ||
|
||
use EolabsIo\AmazonMwsResponseParser\Parsers\BaseParser; | ||
|
||
class RequestReportResponseParser extends BaseParser | ||
{ | ||
public function getContentAccessor(): string | ||
{ | ||
return 'ReportRequestInfo'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace EolabsIo\AmazonMwsClient\Tests; | ||
|
||
use EolabsIo\AmazonMwsResponseParser\Tests\TestCase; | ||
use EolabsIo\AmazonMwsResponseParser\Parsers\RequestReportResponseParser; | ||
use EolabsIo\AmazonMwsResponseParser\Support\Facades\AmazonMwsResponseParser; | ||
|
||
class RequestReportResponseParserTest extends TestCase | ||
{ | ||
|
||
/** @test */ | ||
public function it_can_get_result_accessor() | ||
{ | ||
$file = __DIR__ . '/Stubs/Responses/fetchRequestReport.xml'; | ||
$xmlString = file_get_contents($file); | ||
$xml = simplexml_load_string($xmlString); | ||
|
||
$resultAccessor = (new RequestReportResponseParser($xml) )->getResultAccessor(); | ||
|
||
$this->assertEquals($resultAccessor, 'RequestReportResult'); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_parse_order_list_response() | ||
{ | ||
$file = __DIR__ . '/Stubs/Responses/fetchRequestReport.xml'; | ||
$xmlString = file_get_contents($file); | ||
|
||
$response = AmazonMwsResponseParser::fromString($xmlString); | ||
|
||
$this->assertEquals($response->get('RequestId'), "88faca76-b600-46d2-b53c-0c8c4533e43a"); | ||
$this->assertNull($response->get('NextToken')); | ||
|
||
$this->assertEquals($response['ReportRequestInfo']['ReportRequestId'], "2291326454"); | ||
$this->assertEquals($response['ReportRequestInfo']['ReportType'], "_GET_MERCHANT_LISTINGS_DATA_"); | ||
$this->assertEquals($response['ReportRequestInfo']['StartDate'], "2009-01-21T02:10:39+00:00"); | ||
$this->assertEquals($response['ReportRequestInfo']['ReportProcessingStatus'], "_SUBMITTED_"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<RequestReportResponse | ||
xmlns="http://mws.amazonaws.com/doc/2009-01-01/"> | ||
<RequestReportResult> | ||
<ReportRequestInfo> | ||
<ReportRequestId>2291326454</ReportRequestId> | ||
<ReportType>_GET_MERCHANT_LISTINGS_DATA_</ReportType> | ||
<StartDate>2009-01-21T02:10:39+00:00</StartDate> | ||
<EndDate>2009-02-13T02:10:39+00:00</EndDate> | ||
<Scheduled>false</Scheduled> | ||
<SubmittedDate>2009-02-20T02:10:39+00:00</SubmittedDate> | ||
<ReportProcessingStatus>_SUBMITTED_</ReportProcessingStatus> | ||
</ReportRequestInfo> | ||
</RequestReportResult> | ||
<ResponseMetadata> | ||
<RequestId>88faca76-b600-46d2-b53c-0c8c4533e43a</RequestId> | ||
</ResponseMetadata> | ||
</RequestReportResponse> |