Skip to content

Commit

Permalink
Fixed bug with getProduct() in class AmazonProduct
Browse files Browse the repository at this point in the history
  • Loading branch information
przemekperon committed Oct 30, 2020
1 parent a62e3a9 commit a7729c9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/AmazonReportRequestList.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ protected function parseXML($xml)
$this->reportList[$i]['ReportProcessingStatus'] = (string)$x->ReportProcessingStatus;
$this->reportList[$i]['GeneratedReportId'] = (string)$x->GeneratedReportId;
$this->reportList[$i]['StartedProcessingDate'] = (string)$x->StartedProcessingDate;
$this->reportList[$i]['CompletedProcessingDate'] = (string)$x->CompletedProcessingDate;
$this->reportList[$i]['CompletedDate'] = (string)$x->CompletedDate;

$this->index++;
}
Expand Down Expand Up @@ -694,7 +694,7 @@ public function getDateProcessingCompleted($i = 0)
return false;
}
if (is_int($i)) {
return $this->reportList[$i]['CompletedProcessingDate'];
return $this->reportList[$i]['CompletedDate'];
} else {
return false;
}
Expand All @@ -714,7 +714,7 @@ public function getDateProcessingCompleted($i = 0)
* <li><b>ReportProcessingStatus</b></li>
* <li><b>GeneratedReportId</b></li>
* <li><b>StartedProcessingDate</b></li>
* <li><b>CompletedProcessingDate</b></li>
* <li><b>CompletedDate</b></li>
* </ul>
* @param int $i [optional] <p>List index to retrieve the value from. Defaults to NULL.</p>
* @return array|boolean multi-dimensional array, or <b>FALSE</b> if list not filled yet
Expand Down
2 changes: 1 addition & 1 deletion tests/classes/AmazonReportRequestListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public function testGetList($o){
$x1['ReportProcessingStatus'] = '_DONE_';
$x1['GeneratedReportId'] = '3538561173';
$x1['StartedProcessingDate'] = '2011-02-17T23:44:43+00:00';
$x1['CompletedProcessingDate'] = '2011-02-17T23:44:48+00:00';
$x1['CompletedDate'] = '2011-02-17T23:44:48+00:00';
$x[0] = $x1;

$this->assertEquals($x,$o->getList());
Expand Down
2 changes: 1 addition & 1 deletion tests/mocks/fetchReportRequestList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ReportProcessingStatus>_DONE_</ReportProcessingStatus>
<GeneratedReportId>3538561173</GeneratedReportId>
<StartedProcessingDate>2011-02-17T23:44:43+00:00</StartedProcessingDate>
<CompletedProcessingDate>2011-02-17T23:44:48+00:00</CompletedProcessingDate>
<CompletedDate>2011-02-17T23:44:48+00:00</CompletedDate>
</ReportRequestInfo>
</GetReportRequestListResult>
<ResponseMetadata>
Expand Down
2 changes: 1 addition & 1 deletion tests/mocks/fetchReportRequestListToken.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ReportProcessingStatus>_DONE_</ReportProcessingStatus>
<GeneratedReportId>3538561173</GeneratedReportId>
<StartedProcessingDate>2011-02-17T23:44:43+00:00</StartedProcessingDate>
<CompletedProcessingDate>2011-02-17T23:44:48+00:00</CompletedProcessingDate>
<CompletedDate>2011-02-17T23:44:48+00:00</CompletedDate>
</ReportRequestInfo>
</GetReportRequestListResult>
<ResponseMetadata>
Expand Down
2 changes: 1 addition & 1 deletion tests/mocks/requestlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ReportProcessingStatus>_DONE_</ReportProcessingStatus>
<GeneratedReportId>3538561173</GeneratedReportId>
<StartedProcessingDate>2011-02-17T23:44:43+00:00</StartedProcessingDate>
<CompletedProcessingDate>2011-02-17T23:44:48+00:00</CompletedProcessingDate>
<CompletedDate>2011-02-17T23:44:48+00:00</CompletedDate>
</ReportRequestInfo>
</GetReportRequestListResult>
<ResponseMetadata>
Expand Down
2 changes: 1 addition & 1 deletion tests/mocks/requestlist2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ReportProcessingStatus>_SUBMITTED_</ReportProcessingStatus>
<GeneratedReportId>3538561173</GeneratedReportId>
<StartedProcessingDate>2011-02-17T23:44:43+00:00</StartedProcessingDate>
<CompletedProcessingDate>2011-02-17T23:44:48+00:00</CompletedProcessingDate>
<CompletedDate>2011-02-17T23:44:48+00:00</CompletedDate>
</ReportRequestInfo>
</GetReportRequestListByNextTokenResult>
<ResponseMetadata>
Expand Down

0 comments on commit a7729c9

Please sign in to comment.