Skip to content

Commit

Permalink
Merge pull request #156 from CPIGroup/master
Browse files Browse the repository at this point in the history
Version 1.4.2
  • Loading branch information
Peardian committed Mar 7, 2018
2 parents 317b266 + cb8f5c9 commit bf594dc
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 1.4.2 - 2018-03-07
### Changed
- Fixed timestamp to fully comply with ISO8601 standard

## 1.4.1 - 2018-01-19
### Changed
- Fixed parameter names for Product Fees Estimates
Expand Down
2 changes: 1 addition & 1 deletion includes/classes/AmazonCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ protected function genTime($time=false){
} else {
throw new InvalidArgumentException('Invalid time input given');
}
return date('Y-m-d\TH:i:sO',$time-120);
return date('c', $time-120);

}

Expand Down
4 changes: 2 additions & 2 deletions test-cases/includes/classes/AmazonFeedListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ public function testSetTimeLimits($a, $b, $c, $d){
$o = $this->object->getOptions();
if ($c){
$this->assertArrayHasKey('SubmittedFromDate',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['SubmittedFromDate']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['SubmittedFromDate']);
} else {
$this->assertArrayNotHasKey('SubmittedFromDate',$o);
}

if ($d){
$this->assertArrayHasKey('SubmittedToDate',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['SubmittedToDate']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['SubmittedToDate']);
} else {
$this->assertArrayNotHasKey('SubmittedToDate',$o);
}
Expand Down
4 changes: 2 additions & 2 deletions test-cases/includes/classes/AmazonFinancialEventListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testSetTimeLimits($a, $b, $c, $d){
if ($c) {
$this->assertNull($try);
$this->assertArrayHasKey('PostedAfter', $o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i', $o['PostedAfter']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['PostedAfter']);
$this->assertArrayNotHasKey('AmazonOrderId', $o);
} else {
$this->assertFalse($try);
Expand All @@ -70,7 +70,7 @@ public function testSetTimeLimits($a, $b, $c, $d){

if ($c && $d) {
$this->assertArrayHasKey('PostedBefore', $o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i', $o['PostedBefore']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['PostedBefore']);
//setting only first date resets second one
$this->assertNull($this->object->setTimeLimits($a));
$o2 = $this->object->getOptions();
Expand Down
4 changes: 2 additions & 2 deletions test-cases/includes/classes/AmazonFinancialGroupListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ public function testSetTimeLimits($a, $b, $c, $d){
if ($c) {
$this->assertNull($try);
$this->assertArrayHasKey('FinancialEventGroupStartedAfter', $o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i', $o['FinancialEventGroupStartedAfter']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['FinancialEventGroupStartedAfter']);
} else {
$this->assertFalse($try);
$this->assertArrayNotHasKey('FinancialEventGroupStartedAfter', $o);
}

if ($c && $d) {
$this->assertArrayHasKey('FinancialEventGroupStartedBefore', $o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i', $o['FinancialEventGroupStartedBefore']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['FinancialEventGroupStartedBefore']);
//setting only first date resets second one
$this->assertNull($this->object->setTimeLimits($a));
$o2 = $this->object->getOptions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ public function testSetDeliveryWindow($a, $b, $c) {
$o = $this->object->getOptions();
if ($c) {
$this->assertArrayHasKey('DeliveryWindow.StartDateTime', $o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i', $o['DeliveryWindow.StartDateTime']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['DeliveryWindow.StartDateTime']);
$this->assertArrayHasKey('DeliveryWindow.EndDateTime', $o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i', $o['DeliveryWindow.EndDateTime']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['DeliveryWindow.EndDateTime']);
} else {
$this->assertArrayNotHasKey('DeliveryWindow.StartDateTime', $o);
$this->assertArrayNotHasKey('DeliveryWindow.EndDateTime', $o);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testSetStartTime(){
$this->assertNull($this->object->setStartTime('-1 min'));
$o = $this->object->getOptions();
$this->assertArrayHasKey('QueryStartDateTime',$o);
$this->assertNotEquals('1969-12-31T18:58:00-0500',$o['QueryStartDateTime']);
$this->assertNotEquals('1969-12-31T18:58:00-05:00', $o['QueryStartDateTime']);
}

public function testSetUseToken(){
Expand Down
2 changes: 1 addition & 1 deletion test-cases/includes/classes/AmazonInventoryListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testSetStartTime(){
$this->assertNull($this->object->setStartTime('-1 min'));
$o = $this->object->getOptions();
$this->assertArrayHasKey('QueryStartDateTime',$o);
$this->assertNotEquals('1969-12-31T18:58:00-0500',$o['QueryStartDateTime']);
$this->assertNotEquals('1969-12-31T18:58:00-05:00', $o['QueryStartDateTime']);
$this->assertArrayNotHasKey('SellerSkus.member.1',$o);
}

Expand Down
4 changes: 2 additions & 2 deletions test-cases/includes/classes/AmazonReportListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ public function testSetTimeLimits($a, $b, $c, $d){
$o = $this->object->getOptions();
if ($c){
$this->assertArrayHasKey('AvailableFromDate',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['AvailableFromDate']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['AvailableFromDate']);
} else {
$this->assertArrayNotHasKey('AvailableFromDate',$o);
}

if ($d){
$this->assertArrayHasKey('AvailableToDate',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['AvailableToDate']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['AvailableToDate']);
} else {
$this->assertArrayNotHasKey('AvailableToDate',$o);
}
Expand Down
4 changes: 2 additions & 2 deletions test-cases/includes/classes/AmazonReportRequestListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ public function testSetTimeLimits($a, $b, $c, $d){
$o = $this->object->getOptions();
if ($c){
$this->assertArrayHasKey('RequestedFromDate',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['RequestedFromDate']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['RequestedFromDate']);
} else {
$this->assertArrayNotHasKey('RequestedFromDate',$o);
}

if ($d){
$this->assertArrayHasKey('RequestedToDate',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['RequestedToDate']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['RequestedToDate']);
} else {
$this->assertArrayNotHasKey('RequestedToDate',$o);
}
Expand Down
4 changes: 2 additions & 2 deletions test-cases/includes/classes/AmazonReportRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ public function testSetTimeLimits($a, $b, $c, $d){
$o = $this->object->getOptions();
if ($c){
$this->assertArrayHasKey('StartDate',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['StartDate']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['StartDate']);
} else {
$this->assertArrayNotHasKey('StartDate',$o);
}

if ($d){
$this->assertArrayHasKey('EndDate',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['EndDate']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['EndDate']);
} else {
$this->assertArrayNotHasKey('EndDate',$o);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public function testSetScheduledDate(){
$this->assertNull($this->object->setScheduledDate('-1 min'));
$o = $this->object->getOptions();
$this->assertArrayHasKey('ScheduledDate',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['ScheduledDate']);
$this->assertNotEquals('1969-12-31T18:58:00-0500',$o['ScheduledDate']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['ScheduledDate']);
$this->assertNotEquals('1969-12-31T18:58:00-05:00', $o['ScheduledDate']);
}

public function testManageReportSchedule(){
Expand Down
4 changes: 2 additions & 2 deletions test-cases/includes/classes/AmazonShipmentItemListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public function testSetTimeLimits($a, $b){
$this->object->setTimeLimits($a,$b);
$o = $this->object->getOptions();
$this->assertArrayHasKey('LastUpdatedAfter',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['LastUpdatedAfter']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['LastUpdatedAfter']);
$this->assertArrayHasKey('LastUpdatedBefore',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['LastUpdatedBefore']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['LastUpdatedBefore']);
}

public function testResetTimeLimit(){
Expand Down
4 changes: 2 additions & 2 deletions test-cases/includes/classes/AmazonShipmentListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public function testSetTimeLimits($a, $b){
$this->object->setTimeLimits($a,$b);
$o = $this->object->getOptions();
$this->assertArrayHasKey('LastUpdatedAfter',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['LastUpdatedAfter']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['LastUpdatedAfter']);
$this->assertArrayHasKey('LastUpdatedBefore',$o);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i',$o['LastUpdatedBefore']);
$this->assertStringMatchesFormat('%d-%d-%dT%d:%d:%d%i:%i', $o['LastUpdatedBefore']);
}

public function testResetTimeLimit(){
Expand Down

0 comments on commit bf594dc

Please sign in to comment.