27-05-2026 Update DHL Modul v2.0

This commit is contained in:
Kevin 2026-05-27 13:40:38 +00:00
parent 53bdba33cd
commit 036595be94
41 changed files with 3346 additions and 310 deletions

View file

@ -0,0 +1,35 @@
<?php
use Acme\Dhl\Models\DhlShipment;
use App\Jobs\TrackShipmentJob;
use App\Services\DhlTrackingService;
use Mockery\MockInterface;
afterEach(function () {
Mockery::close();
});
it('uses the current DHL tracking service for queued tracking updates', function () {
$shipment = new DhlShipment([
'id' => 123,
'dhl_shipment_no' => '00340434161094000001',
'status' => 'created',
]);
$options = ['auto_retrack' => false];
$job = new TrackShipmentJob($shipment, $options);
/** @var DhlTrackingService&MockInterface $trackingService */
$trackingService = Mockery::mock(DhlTrackingService::class);
$trackingService
->shouldReceive('updateTrackingNow')
->once()
->with($shipment, $options)
->andReturn([
'success' => true,
'tracking_status' => 'transit',
'tracking_completed' => false,
]);
$job->handle($trackingService);
});