-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support 'Y-m-d\TH:i:s.vp' date format for GetMyFeesEstimateResponse
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 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
28 changes: 28 additions & 0 deletions
28
tests/Seller/ProductFeesV0/Responses/GetMyFeesEstimateResponseTest.php
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,28 @@ | ||
<?php | ||
|
||
namespace Seller\ReportsV20210630\Responses; | ||
|
||
use DateTime; | ||
use DateTimeInterface; | ||
use PHPUnit\Framework\TestCase; | ||
use SellingPartnerApi\Seller\ProductFeesV0\Responses\GetMyFeesEstimateResponse; | ||
|
||
class GetMyFeesEstimateResponseTest extends TestCase | ||
{ | ||
public function testDeserializeDateTime() | ||
{ | ||
$now = new DateTime(); | ||
$result = GetMyFeesEstimateResponse::deserialize([ | ||
'payload' => [ | ||
'FeesEstimateResult' => [ | ||
'status' => 'Success', | ||
'FeesEstimate' => [ | ||
'TimeOfFeesEstimation' => $now->format('Y-m-d\TH:i:s.vp'), | ||
], | ||
], | ||
], | ||
]); | ||
$this->assertNotNull($result); | ||
$this->assertInstanceOf(DateTimeInterface::class, $result->payload->feesEstimateResult->feesEstimate->timeOfFeesEstimation); | ||
} | ||
} |