diff --git a/src/Collection/Fulfilment/OrderCollection.php b/src/Collection/Fulfilment/OrderCollection.php index 9a61a2b3..ca704407 100644 --- a/src/Collection/Fulfilment/OrderCollection.php +++ b/src/Collection/Fulfilment/OrderCollection.php @@ -96,7 +96,12 @@ function (Order $order) { 'pickup' => $order->getPickupLocation() ? $order->getPickupLocation()->toArrayWithoutNull() : null, 'drop_off_point' => $dropOffPointAsArray, 'customs_declaration' => $order->getCustomsDeclaration(), - 'physical_properties' => ['weight' => $order->getWeight()], + 'physical_properties' => [ + 'weight' => $order->getWeight(), + 'height' => 1, + 'length' => 1, + 'width' => 1, + ], ], ]; } diff --git a/test/Model/Consignment/ConsignmentShipmentOptionsTest.php b/test/Model/Consignment/ConsignmentShipmentOptionsTest.php index d50f2685..b992ff6f 100644 --- a/test/Model/Consignment/ConsignmentShipmentOptionsTest.php +++ b/test/Model/Consignment/ConsignmentShipmentOptionsTest.php @@ -113,9 +113,9 @@ public function provideLargeFormatData(): array AbstractConsignment::CC_BE ), self::LARGE_FORMAT => true, - self::expected(self::INSURANCE) => 500, - self::expected(self::ONLY_RECIPIENT) => true, - self::expected(self::SIGNATURE) => true, + self::expected(self::INSURANCE) => 0, + self::expected(self::ONLY_RECIPIENT) => false, + self::expected(self::SIGNATURE) => false, ], ]); } diff --git a/test/Model/Consignment/PostNLConsignmentTest.php b/test/Model/Consignment/PostNLConsignmentTest.php index 7b651f70..bdafb53c 100644 --- a/test/Model/Consignment/PostNLConsignmentTest.php +++ b/test/Model/Consignment/PostNLConsignmentTest.php @@ -19,9 +19,9 @@ public function providePostNLConsignmentsData(): array return $this->createConsignmentProviderDataset([ 'NL -> NL' => [], 'NL -> BE' => $this->getDefaultAddress(AbstractConsignment::CC_BE) + [ - self::expected(self::INSURANCE) => 500, - self::expected(self::ONLY_RECIPIENT) => true, - self::expected(self::SIGNATURE) => true, + self::expected(self::INSURANCE) => 0, + self::expected(self::ONLY_RECIPIENT) => false, + self::expected(self::SIGNATURE) => false, ], 'BE -> BE' => $this->getDefaultAddress(AbstractConsignment::CC_BE) + [ self::API_KEY => $this->getApiKey(self::ENV_API_KEY_BE), diff --git a/test/Model/Fulfilment/OrderCollectionTest.php b/test/Model/Fulfilment/OrderCollectionTest.php index 806f7b64..6add023c 100644 --- a/test/Model/Fulfilment/OrderCollectionTest.php +++ b/test/Model/Fulfilment/OrderCollectionTest.php @@ -32,15 +32,6 @@ class OrderCollectionTest extends TestCase 'street' => 'Telderskade', ]; - /** - * @return void - * @before - */ - public function before(): void - { - self::skipUnlessEnabled(self::ENV_TEST_ORDERS, 'The Order API is not available on production yet.'); - } - /** * @throws \MyParcelNL\Sdk\src\Exception\AccountNotActiveException * @throws \MyParcelNL\Sdk\src\Exception\ApiException @@ -83,6 +74,7 @@ public function testSave(): void $orderLines = $this->generateOrderLines(3); $order->setOrderLines($orderLines); + $order->setWeight($orderLines->sum('weight')); $orderCollection->push($order); } @@ -112,13 +104,15 @@ static function (Order $savedOrder) use (&$i, $orderCollection) { $originalOrder->getInvoiceAddress() ->toArray(), $savedOrder->getInvoiceAddress() - ->toArray() + ->toArray(), + 'invoice address is not the same' ); self::assertArraySame( $originalOrder->getRecipient() ->toArray(), $savedOrder->getRecipient() - ->toArray() + ->toArray(), + 'recipient is not the same' ); $savedOrder