id())->toBe($id) ->and($entity->id)->toBe($id) ->and($entity->name)->toBe($name) ->and($entity->address)->toBe($address) ->and($entity->postcode)->toBe($postcode) ->and($entity->city)->toBe($city) ->and($entity->phone)->toBe($phone) ->and($entity->latitude)->toBe($lat) ->and($entity->longitude)->toBe($lon) ->and($entity->isDefault)->toBe($isDefault); }); it('throws exception if name is empty', function (): void { // GIVEN $id = new ShopId(Uuid::uuid7()); // WHEN $action = fn () => new Shop($id, '', 'Address', '12345', 'City'); // THEN expect($action)->toThrow(\DomainException::class, 'name cannot be empty'); }); it('throws exception if address is empty', function (): void { // GIVEN $id = new ShopId(Uuid::uuid7()); // WHEN $action = fn () => new Shop($id, 'Name', '', '12345', 'City'); // THEN expect($action)->toThrow(\DomainException::class, 'address cannot be empty'); }); it('throws exception if postcode is empty', function (): void { // GIVEN $id = new ShopId(Uuid::uuid7()); // WHEN $action = fn () => new Shop($id, 'Name', 'Address', '', 'City'); // THEN expect($action)->toThrow(\DomainException::class, 'postcode cannot be empty'); }); it('throws exception if city is empty', function (): void { // GIVEN $id = new ShopId(Uuid::uuid7()); // WHEN $action = fn () => new Shop($id, 'Name', 'Address', '12345', ''); // THEN expect($action)->toThrow(\DomainException::class, 'city cannot be empty'); }); });