Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wthijmen committed Dec 4, 2023
1 parent 2625a81 commit fc7d224
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Helper/MyParcelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use MyParcelNL\Sdk\src\Exception\MissingFieldException;
use MyParcelNL\Sdk\src\Factory\ConsignmentFactory;
use MyParcelNL\Sdk\src\Model\Carrier\CarrierInstabox;
use MyParcelNL\Sdk\src\Model\Carrier\CarrierUPS;
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;
use MyParcelNL\Sdk\src\Model\Consignment\BaseConsignment;
use MyParcelNL\Sdk\src\Model\MyParcelRequest;
Expand Down Expand Up @@ -829,7 +830,7 @@ private function getNewCollectionFromResult($result): self
$consignment = ConsignmentFactory::createByCarrierId($shipment['carrier_id'])->setApiKey($apiKey);

//TODO: MY-32524 Make AbstractConsignmentAdapter for carrier specific exceptions
if (CarrierInstabox::ID === $shipment['carrier_id']) {
if (CarrierInstabox::ID === $shipment['carrier_id'] || CarrierUPS::ID === $shipment['carrier_id']) {
$shipment['barcode'] = $shipment['barcode'] ?: $shipment['external_identifier'];
}

Expand Down
12 changes: 8 additions & 4 deletions test/Model/Consignment/UPSConsignmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace MyParcelNL\Sdk\Test\Model\Consignment;

use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLEuroplus;
use MyParcelNL\Sdk\src\Model\Carrier\CarrierUPS;
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;
use MyParcelNL\Sdk\Test\Bootstrap\ConsignmentTestCase;

class UPSConsignmentTest extends ConsignmentTestCase
Expand All @@ -16,7 +18,7 @@ class UPSConsignmentTest extends ConsignmentTestCase
public function provideUPSConsignmentsData(): array
{
return $this->createConsignmentProviderDataset([
'NL -> NL' => $this->getDefaultAddress(),
'NL -> EU' => [],
]);
}

Expand All @@ -42,9 +44,11 @@ protected function getDefaultConsignmentData(): array
parent::getDefaultConsignmentData(),
[
self::CARRIER_ID => CarrierUPS::ID,
self::FULL_STREET => 'Meander 631',
self::POSTAL_CODE => '6825ME',
self::CITY => 'Arnhem',
self::PACKAGE_TYPE => AbstractConsignment::PACKAGE_TYPE_PACKAGE,
self::FULL_STREET => 'Feldstrasse 17',
self::POSTAL_CODE => '39394',
self::CITY => 'Schwanebeck',
self::COUNTRY => 'DE',
self::PHONE => '123456',
]
);
Expand Down

0 comments on commit fc7d224

Please sign in to comment.