diff --git a/tests/.pest/snapshots/Countries/SwitzerlandTest/it_can_translate_swiss_holidays.snap b/tests/.pest/snapshots/Countries/SwitzerlandTest/it_can_translate_swiss_holidays_into_french.snap similarity index 100% rename from tests/.pest/snapshots/Countries/SwitzerlandTest/it_can_translate_swiss_holidays.snap rename to tests/.pest/snapshots/Countries/SwitzerlandTest/it_can_translate_swiss_holidays_into_french.snap diff --git a/tests/.pest/snapshots/Countries/SwitzerlandTest/it_can_translate_swiss_holidays_into_italian.snap b/tests/.pest/snapshots/Countries/SwitzerlandTest/it_can_translate_swiss_holidays_into_italian.snap new file mode 100644 index 000000000..b40b5b698 --- /dev/null +++ b/tests/.pest/snapshots/Countries/SwitzerlandTest/it_can_translate_swiss_holidays_into_italian.snap @@ -0,0 +1,38 @@ +[ + { + "name": "Capodanno", + "date": "2024-01-01" + }, + { + "name": "San Silvestro", + "date": "2024-01-02" + }, + { + "name": "Venerd\u00ec Santo", + "date": "2024-03-29" + }, + { + "name": "Luned\u00ec di Pasqua", + "date": "2024-04-01" + }, + { + "name": "Ascensione", + "date": "2024-05-09" + }, + { + "name": "Luned\u00ec di Pentecoste", + "date": "2024-05-20" + }, + { + "name": "Festa nazionale", + "date": "2024-08-01" + }, + { + "name": "Natale", + "date": "2024-12-25" + }, + { + "name": "Santo Stefano", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/SwitzerlandTest.php b/tests/Countries/SwitzerlandTest.php index dabb75433..1b3ba626a 100644 --- a/tests/Countries/SwitzerlandTest.php +++ b/tests/Countries/SwitzerlandTest.php @@ -37,12 +37,18 @@ new Switzerland('ch-xx'); })->throws(InvalidRegion::class); -it('can translate swiss holidays', function() { - CarbonImmutable::setTestNowAndTimezone('2024-01-01'); +it('can translate swiss holidays into french', function() { + $holidays = Holidays::for(country: 'ch', locale: 'fr', year: 2024)->get(); - $switzerland = new Switzerland(locale: 'fr'); + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); - $holidays = Holidays::for($switzerland)->get(); + expect(formatDates($holidays))->toMatchSnapshot(); +}); + +it('can translate swiss holidays into italian', function() { + $holidays = Holidays::for(country: 'ch', locale: 'it', year: 2024)->get(); expect($holidays) ->toBeArray() @@ -50,7 +56,3 @@ expect(formatDates($holidays))->toMatchSnapshot(); }); - -it('throws an error when an invalid locale is given', function () { - new Switzerland(locale: 'xx'); -})->throws(InvalidRegion::class);