[ 'replacement_date' => '2026-06-01', 'order_deadline_at' => '2026-05-31 18:00:00', ], 123 => [ 'replacement_date' => null, 'order_deadline_at' => null, ], ]; // WHEN $input = new UpdateShopPickupExceptionsInput( shop: $shop, syncData: $syncData, ); // THEN expect($input->shop)->toBe($shop) ->and($input->syncData)->toBe($syncData); }); test('it can be instantiated with empty sync data', function () { // GIVEN $shop = new Shop(); // WHEN $input = new UpdateShopPickupExceptionsInput( shop: $shop, syncData: [], ); // THEN expect($input->shop)->toBe($shop) ->and($input->syncData)->toBe([]); }); test('it throws when sync item is not an array', function () { // GIVEN $shop = new Shop(); $invalidSyncData = [ 'key1' => 'invalid-not-array', ]; // WHEN & THEN /** @phpstan-ignore-next-line */ expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) ->toThrow(InvalidArgumentException::class, 'Each sync item must be an array.'); }); test('it throws when replacement_date key is missing', function () { // GIVEN $shop = new Shop(); $invalidSyncData = [ 'key1' => [ 'order_deadline_at' => '2026-05-31 18:00:00', ], ]; // WHEN & THEN /** @phpstan-ignore-next-line */ expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) ->toThrow(InvalidArgumentException::class, 'Sync item must contain replacement_date key.'); }); test('it throws when order_deadline_at key is missing', function () { // GIVEN $shop = new Shop(); $invalidSyncData = [ 'key1' => [ 'replacement_date' => '2026-06-01', ], ]; // WHEN & THEN /** @phpstan-ignore-next-line */ expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) ->toThrow(InvalidArgumentException::class, 'Sync item must contain order_deadline_at key.'); }); test('it throws when replacement_date is not string or null', function () { // GIVEN $shop = new Shop(); $invalidSyncData = [ 'key1' => [ 'replacement_date' => 12345, 'order_deadline_at' => null, ], ]; // WHEN & THEN /** @phpstan-ignore-next-line */ expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) ->toThrow(InvalidArgumentException::class, 'replacement_date must be a string or null.'); }); test('it throws when order_deadline_at is not string or null', function () { // GIVEN $shop = new Shop(); $invalidSyncData = [ 'key1' => [ 'replacement_date' => null, 'order_deadline_at' => ['invalid'], ], ]; // WHEN & THEN /** @phpstan-ignore-next-line */ expect(fn () => new UpdateShopPickupExceptionsInput(shop: $shop, syncData: $invalidSyncData)) ->toThrow(InvalidArgumentException::class, 'order_deadline_at must be a string or null.'); }); });