shop)->toBe($shop) ->and($input->name)->toBe($name) ->and($input->address)->toBe($address) ->and($input->postcode)->toBe($postcode) ->and($input->city)->toBe($city) ->and($input->phone)->toBe($phone) ->and($input->coordinates)->toBe($coordinates) ->and($input->default)->toBeFalse(); }); test('it throws when name is empty', function () { // GIVEN $shop = new Shop(); // WHEN & THEN expect(fn () => new UpdateShopInput( shop: $shop, name: ' ', address: '1 rue de Paris', postcode: '75000', city: 'Paris', phone: null, coordinates: null, default: false, ))->toThrow(InvalidArgumentException::class, 'Shop name cannot be empty.'); }); test('it throws when address is empty', function () { // GIVEN $shop = new Shop(); // WHEN & THEN expect(fn () => new UpdateShopInput( shop: $shop, name: 'Boutique', address: ' ', postcode: '75000', city: 'Paris', phone: null, coordinates: null, default: false, ))->toThrow(InvalidArgumentException::class, 'Shop address cannot be empty.'); }); test('it throws when postcode is empty', function () { // GIVEN $shop = new Shop(); // WHEN & THEN expect(fn () => new UpdateShopInput( shop: $shop, name: 'Boutique', address: '1 rue de Paris', postcode: ' ', city: 'Paris', phone: null, coordinates: null, default: false, ))->toThrow(InvalidArgumentException::class, 'Shop postcode cannot be empty.'); }); test('it throws when city is empty', function () { // GIVEN $shop = new Shop(); // WHEN & THEN expect(fn () => new UpdateShopInput( shop: $shop, name: 'Boutique', address: '1 rue de Paris', postcode: '75000', city: ' ', phone: null, coordinates: null, default: false, ))->toThrow(InvalidArgumentException::class, 'Shop city cannot be empty.'); }); test('it throws when name exceeds 255 characters', function () { // GIVEN $shop = new Shop(); // WHEN & THEN expect(fn () => new UpdateShopInput( shop: $shop, name: str_repeat('a', 256), address: '1 rue de Paris', postcode: '75000', city: 'Paris', phone: null, coordinates: null, default: false, ))->toThrow(InvalidArgumentException::class, 'Shop name cannot exceed 255 characters.'); }); });