Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove instabox from carrierfactory #449

Merged
merged 3 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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