orderId)->toBe($orderId) ->and($event->reference)->toBe($reference); }); it('throws exception if lines are empty', function () { // GIVEN $uuid = Uuid::uuid7(); $orderId = new OrderId($uuid); $reference = new OrderReference(Uuid::uuid7()); $totalTtc = new Money(1000, new Currency('EUR')); $matricule = new Matricule('1234567'); $employee = new OrderEmployee($matricule, 'John', 'Doe', new ShopperEstablishmentCode('ETAB01'), new ShopperSiteCode('SITEA'), new ShopperServiceCode('101')); $shop = new OrderPlacedShop('Shop', 'Address', '12345', 'City'); $pickupDay = new \DateTimeImmutable(); $lines = []; // WHEN $action = fn () => new AnOrderHasBeenPlaced($orderId, $reference, $totalTtc, $matricule, $employee, $shop, $pickupDay, $lines); // THEN expect($action)->toThrow(\DomainException::class, 'An order must have at least one line'); }); });