From 5fc21902560f2ab50d995db82b8f836906de2e30 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Mon, 15 Jan 2024 11:55:39 +0100 Subject: [PATCH] fix a day for NL --- src/Countries/Netherlands.php | 2 +- .../it_can_calculate_dutch_holidays.snap | 2 +- ...alls_to_different_countries_and_years.snap | 46 +++++++++++++++++++ tests/HolidaysTest.php | 8 ++++ 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 tests/.pest/snapshots/HolidaysTest/it_can_nest_calls_to_different_countries_and_years.snap diff --git a/src/Countries/Netherlands.php b/src/Countries/Netherlands.php index 50a5db879..a7a695df5 100644 --- a/src/Countries/Netherlands.php +++ b/src/Countries/Netherlands.php @@ -26,7 +26,7 @@ protected function fixedHolidays(int $year): array { $dates = [ 'Nieuwjaar' => '01-01', - 'Bevrijdingsdag' => '01-05', + 'Bevrijdingsdag' => '05-05', 'Kerstmis' => '25-12', '2de Kerstdag' => '26-12', 'Oudjaar' => '31-12', diff --git a/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap b/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap index bcf65bc05..fe04ed8af 100644 --- a/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap +++ b/tests/.pest/snapshots/Countries/NetherlandsTest/it_can_calculate_dutch_holidays.snap @@ -17,7 +17,7 @@ }, { "name": "Bevrijdingsdag", - "date": "01-05-2024" + "date": "05-05-2024" }, { "name": "OLH Hemelvaart", diff --git a/tests/.pest/snapshots/HolidaysTest/it_can_nest_calls_to_different_countries_and_years.snap b/tests/.pest/snapshots/HolidaysTest/it_can_nest_calls_to_different_countries_and_years.snap new file mode 100644 index 000000000..ae64fa4de --- /dev/null +++ b/tests/.pest/snapshots/HolidaysTest/it_can_nest_calls_to_different_countries_and_years.snap @@ -0,0 +1,46 @@ +[ + { + "name": "Nieuwjaar", + "date": "01-01-2023" + }, + { + "name": "Goede vrijdag", + "date": "07-04-2023" + }, + { + "name": "Paasmaandag", + "date": "10-04-2023" + }, + { + "name": "Koningsdag", + "date": "27-04-2023" + }, + { + "name": "Bevrijdingsdag", + "date": "05-05-2023" + }, + { + "name": "OLH Hemelvaart", + "date": "18-05-2023" + }, + { + "name": "Pinksteren", + "date": "28-05-2023" + }, + { + "name": "Pinkstermaandag", + "date": "29-05-2023" + }, + { + "name": "Kerstmis", + "date": "25-12-2023" + }, + { + "name": "2de Kerstdag", + "date": "26-12-2023" + }, + { + "name": "Oudjaar", + "date": "31-12-2023" + } +] \ No newline at end of file diff --git a/tests/HolidaysTest.php b/tests/HolidaysTest.php index a2566e5f3..bd58e175b 100644 --- a/tests/HolidaysTest.php +++ b/tests/HolidaysTest.php @@ -74,3 +74,11 @@ $result = Holidays::new()->getName(CarbonImmutable::parse('2024-01-02'), 'be'); expect($result)->toBeNull(); }); + +it('can nest calls to different countries and years', function () { + $belgium = Holidays::get(country: 'be', year: 2024); + + $netherlands = Holidays::get(country: 'nl', year: 2023); + + expect($netherlands)->toMatchSnapshot(); +});