matricule)->toBe($matricule) ->and($employee->firstname)->toBe('John') ->and($employee->lastname)->toBe('Doe') ->and($employee->facility)->toBe($facility) ->and($employee->site)->toBe($site) ->and($employee->service)->toBe($service); }); it('throws exception if firstname is empty', function (): void { // GIVEN $matricule = new Matricule('1234567'); $facility = new ShopperEstablishmentCode('ETAB01'); $site = new ShopperSiteCode('SITEA'); $service = new ShopperServiceCode('101'); // WHEN $action = fn () => new OrderEmployee($matricule, '', 'Doe', $facility, $site, $service); // THEN expect($action)->toThrow(\DomainException::class, 'firstname cannot be empty'); }); it('throws exception if lastname is empty', function (): void { // GIVEN $matricule = new Matricule('1234567'); $facility = new ShopperEstablishmentCode('ETAB01'); $site = new ShopperSiteCode('SITEA'); $service = new ShopperServiceCode('101'); // WHEN $action = fn () => new OrderEmployee($matricule, 'John', '', $facility, $site, $service); // THEN expect($action)->toThrow(\DomainException::class, 'lastname cannot be empty'); }); });