27-05-2026 Update DHL Modul v2.0
This commit is contained in:
parent
53bdba33cd
commit
036595be94
41 changed files with 3346 additions and 310 deletions
35
tests/Unit/Dhl/TrackShipmentJobTest.php
Normal file
35
tests/Unit/Dhl/TrackShipmentJobTest.php
Normal 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);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue