Skip to content

Commit

Permalink
fix: remove instabox from carrierfactory (#449)
Browse files Browse the repository at this point in the history
* fix: remove instabox

* fix: tests

* test: use existing dropoffpoint

---------

Co-authored-by: joerivanveen <joeri@myparcel.nl>
  • Loading branch information
Mark-Ernst and joerivanveen committed Apr 4, 2023
1 parent b6bf2c5 commit 5bb7bee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/Model/Carrier/CarrierFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class CarrierFactory
CarrierBpost::class,
CarrierDPD::class,
CarrierPostNL::class,
CarrierInstabox::class,
CarrierDHLForYou::class,
CarrierDHLParcelConnect::class,
CarrierDHLEuroplus::class
Expand Down
20 changes: 10 additions & 10 deletions test/Factory/Account/CarrierConfigurationFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ 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',
'number' => '24',
'number_suffix' => 'K',
'postal_code' => '6827DE',
'city' => 'Hoofddorp',
'location_code' => '217171',
'location_name' => 'PostNL',
'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,
],
Expand All @@ -54,10 +54,10 @@ 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',
'default_drop_off_point' => '217171',
'monday_cutoff_time' => '09:30',
],
],
Expand Down
10 changes: 5 additions & 5 deletions test/Services/DropOffPointServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -19,11 +19,11 @@ class DropOffPointServiceTest extends TestCase
*/
public function testGetDropOffPoint(): void
{
$service = (new DropOffPointWebService(new CarrierInstabox()))->setApiKey($this->getApiKey());
$result = $service->getDropOffPoint('e9149b66-7bee-439b-bab0-7a5d92ddc519');
$service = (new DropOffPointWebService(new CarrierPostNL()))->setApiKey($this->getApiKey());
$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');
}
Expand All @@ -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');
Expand Down

0 comments on commit 5bb7bee

Please sign in to comment.