Skip to content

Commit

Permalink
Fix datetime format for orderpickup request
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-novotny committed May 22, 2023
1 parent 5e939ff commit 7b3e3e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Service/DefaultPackageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ public function orderPickup(
): void {
$response = $this->client->call(Version::V2V1, $carrier, Method::ORDER_PICKUP, [
'date' => $dateFrom->format('Y-m-d'),
'time_from' => $dateFrom->format('H:s'),
'time_to' => $dateTo->format('H:s'),
'time_from' => $dateFrom->format('H:i'),
'time_to' => $dateTo->format('H:i'),
'weight' => $weight,
'package_count' => $packageCount,
'message' => $message,
Expand Down
20 changes: 10 additions & 10 deletions tests/Unit/Service/DefaultPackageServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ public function testOrderB2AShipment(): void
public function testOrderPickup(): void
{
$carrier = Carrier::PPL;
$dateFrom = new DateTimeImmutable('2020-08-01 16:00:00');
$dateTo = new DateTimeImmutable('2020-08-01 19:00:00');
$dateFrom = new DateTimeImmutable('2020-08-01 16:10:00');
$dateTo = new DateTimeImmutable('2020-08-01 19:20:00');
$weight = 15.6;
$packageCount = 2;
$message = 'testMessage';
Expand All @@ -649,9 +649,9 @@ public function testOrderPickup(): void
$carrier,
Method::ORDER_PICKUP,
[
'date' => $dateFrom->format('Y-m-d'),
'time_from' => $dateFrom->format('H:s'),
'time_to' => $dateTo->format('H:s'),
'date' => '2020-08-01',
'time_from' => '16:10',
'time_to' => '19:20',
'weight' => $weight,
'package_count' => $packageCount,
'message' => $message,
Expand All @@ -677,8 +677,8 @@ public function testOrderPickupWithError(): void
$this->expectExceptionMessage($errorMessage);

$carrier = Carrier::PPL;
$dateFrom = new DateTimeImmutable('2020-08-01 16:00:00');
$dateTo = new DateTimeImmutable('2020-08-01 19:00:00');
$dateFrom = new DateTimeImmutable('2020-08-01 16:10:00');
$dateTo = new DateTimeImmutable('2020-08-01 19:20:00');
$weight = 15.6;
$packageCount = 2;
$message = 'testMessage';
Expand All @@ -693,9 +693,9 @@ public function testOrderPickupWithError(): void
$carrier,
Method::ORDER_PICKUP,
[
'date' => $dateFrom->format('Y-m-d'),
'time_from' => $dateFrom->format('H:s'),
'time_to' => $dateTo->format('H:s'),
'date' => '2020-08-01',
'time_from' => '16:10',
'time_to' => '19:20',
'weight' => $weight,
'package_count' => $packageCount,
'message' => $message,
Expand Down

0 comments on commit 7b3e3e1

Please sign in to comment.