addDay(); $deadline = CarbonImmutable::now()->subDay(); // WHEN $shopPickup = new ShopPickupOverride( $exception, $replacement, $deadline ); // THEN expect($shopPickup->exception)->toBe($exception) ->and($shopPickup->replacementDate)->toBe($replacement) ->and($shopPickup->orderDeadlineAt)->toBe($deadline); }); it('throws exception if orderDeadlineAt is not strictly before replacementDate', function (): void { // GIVEN $exception = new PickupExceptionOnDate( new PickupExceptionId(Uuid::uuid7()), CarbonImmutable::now(), 'Label', true, RepeatFrequency::YEARLY, false ); $replacement = CarbonImmutable::now(); $deadline = CarbonImmutable::now()->addDay(); // WHEN $action = fn () => new ShopPickupOverride( $exception, $replacement, $deadline ); // THEN expect($action)->toThrow(\DomainException::class, 'Order deadline must be strictly before the replacement date'); }); });