From 1511a21b7b3621af93941e6dd88149c08f76716a Mon Sep 17 00:00:00 2001 From: markernst97 Date: Tue, 4 Apr 2023 09:45:52 +0200 Subject: [PATCH 1/3] fix: remove instabox --- src/Model/Carrier/CarrierFactory.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Model/Carrier/CarrierFactory.php b/src/Model/Carrier/CarrierFactory.php index 86d68f5e..bc83d7d8 100644 --- a/src/Model/Carrier/CarrierFactory.php +++ b/src/Model/Carrier/CarrierFactory.php @@ -16,7 +16,6 @@ class CarrierFactory CarrierBpost::class, CarrierDPD::class, CarrierPostNL::class, - CarrierInstabox::class, CarrierDHLForYou::class, CarrierDHLParcelConnect::class, CarrierDHLEuroplus::class From 81ab6dadc1dee0fed72067fef0d3b43fce88379f Mon Sep 17 00:00:00 2001 From: markernst97 Date: Tue, 4 Apr 2023 10:10:54 +0200 Subject: [PATCH 2/3] fix: tests --- test/Factory/Account/CarrierConfigurationFactoryTest.php | 6 +++--- test/Services/DropOffPointServiceTest.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Factory/Account/CarrierConfigurationFactoryTest.php b/test/Factory/Account/CarrierConfigurationFactoryTest.php index 86c23541..b71f04f8 100644 --- a/test/Factory/Account/CarrierConfigurationFactoryTest.php +++ b/test/Factory/Account/CarrierConfigurationFactoryTest.php @@ -27,13 +27,13 @@ public function provideCreateCarrierConfigurationData(): array // ], 'With existing dropoff point' => [ [ - 'carrier_id' => 5, + 'carrier_id' => 1, 'default_drop_off_point' => [ 'box_number' => null, 'cc' => 'NL', 'city' => 'Arnhem', 'location_code' => '73658f70-417a-48d2-82bb-291f3dccce93', - 'location_name' => 'Instabox', + 'location_name' => 'PostNL', 'number' => '24', 'number_suffix' => 'K', 'postal_code' => '6827DE', @@ -54,7 +54,7 @@ public function provideCreateCarrierConfigurationData(): array // ], 'From API' => [ [ - 'carrier_id' => 5, + 'carrier_id' => 1, 'configuration' => [ 'default_cutoff_time' => '09:30', 'default_drop_off_point' => 'e9149b66-7bee-439b-bab0-7a5d92ddc519', diff --git a/test/Services/DropOffPointServiceTest.php b/test/Services/DropOffPointServiceTest.php index a1879da8..4c9e4f86 100644 --- a/test/Services/DropOffPointServiceTest.php +++ b/test/Services/DropOffPointServiceTest.php @@ -5,7 +5,7 @@ namespace MyParcelNL\Sdk\Test\Services; use Exception; -use MyParcelNL\Sdk\src\Model\Carrier\CarrierInstabox; +use MyParcelNL\Sdk\src\Model\Carrier\CarrierPostNL; use MyParcelNL\Sdk\src\Services\Web\DropOffPointWebService; use MyParcelNL\Sdk\Test\Bootstrap\TestCase; @@ -19,7 +19,7 @@ class DropOffPointServiceTest extends TestCase */ public function testGetDropOffPoint(): void { - $service = (new DropOffPointWebService(new CarrierInstabox()))->setApiKey($this->getApiKey()); + $service = (new DropOffPointWebService(new CarrierPostNL()))->setApiKey($this->getApiKey()); $result = $service->getDropOffPoint('e9149b66-7bee-439b-bab0-7a5d92ddc519'); if ($result) { @@ -37,7 +37,7 @@ public function testGetDropOffPoint(): void */ public function testGetDropOffPoints(): void { - $service = (new DropOffPointWebService(new CarrierInstabox()))->setApiKey($this->getApiKey()); + $service = (new DropOffPointWebService(new CarrierPostNL()))->setApiKey($this->getApiKey()); $dropOffPoints = $service->getDropOffPoints('6825ME'); self::assertNotEmpty($dropOffPoints->all(), 'No dropoff points found'); From 2d1470b9dbea97534f277186e8dc90a5d5e51109 Mon Sep 17 00:00:00 2001 From: joerivanveen Date: Tue, 4 Apr 2023 10:33:56 +0200 Subject: [PATCH 3/3] test: use existing dropoffpoint --- .../Account/CarrierConfigurationFactoryTest.php | 14 +++++++------- test/Services/DropOffPointServiceTest.php | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/Factory/Account/CarrierConfigurationFactoryTest.php b/test/Factory/Account/CarrierConfigurationFactoryTest.php index b71f04f8..2910bbfc 100644 --- a/test/Factory/Account/CarrierConfigurationFactoryTest.php +++ b/test/Factory/Account/CarrierConfigurationFactoryTest.php @@ -31,16 +31,16 @@ public function provideCreateCarrierConfigurationData(): array 'default_drop_off_point' => [ 'box_number' => null, 'cc' => 'NL', - 'city' => 'Arnhem', - 'location_code' => '73658f70-417a-48d2-82bb-291f3dccce93', + 'city' => 'Hoofddorp', + 'location_code' => '217171', 'location_name' => 'PostNL', - 'number' => '24', - 'number_suffix' => 'K', - 'postal_code' => '6827DE', + 'number' => '124', + 'number_suffix' => null, + 'postal_code' => '2132DM', 'region' => null, 'retail_network_id' => null, 'state' => null, - 'street' => 'Hondsstraat', + 'street' => 'Marktlaan', ], 'default_drop_off_point_identifier' => null, ], @@ -57,7 +57,7 @@ public function provideCreateCarrierConfigurationData(): array 'carrier_id' => 1, 'configuration' => [ 'default_cutoff_time' => '09:30', - 'default_drop_off_point' => 'e9149b66-7bee-439b-bab0-7a5d92ddc519', + 'default_drop_off_point' => '217171', 'monday_cutoff_time' => '09:30', ], ], diff --git a/test/Services/DropOffPointServiceTest.php b/test/Services/DropOffPointServiceTest.php index 4c9e4f86..6ea069f9 100644 --- a/test/Services/DropOffPointServiceTest.php +++ b/test/Services/DropOffPointServiceTest.php @@ -20,10 +20,10 @@ class DropOffPointServiceTest extends TestCase public function testGetDropOffPoint(): void { $service = (new DropOffPointWebService(new CarrierPostNL()))->setApiKey($this->getApiKey()); - $result = $service->getDropOffPoint('e9149b66-7bee-439b-bab0-7a5d92ddc519'); + $result = $service->getDropOffPoint('217171'); if ($result) { - self::assertEquals('e9149b66-7bee-439b-bab0-7a5d92ddc519', $result->getLocationCode()); + self::assertEquals('217171', $result->getLocationCode()); } else { throw new Exception('Not one drop off point returned for external identifier'); }