From 7a09493793cf481a6d69844acaaea30c07fde4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <73190968+UrbinCedric@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:53:02 +0100 Subject: [PATCH] Add holidays for Luxembourg (#165) --- src/Countries/Luxembourg.php | 39 ++++++++++++++++ ..._can_calculate_luxembourgish_holidays.snap | 46 +++++++++++++++++++ tests/Countries/LuxembourgTest.php | 18 ++++++++ 3 files changed, 103 insertions(+) create mode 100644 src/Countries/Luxembourg.php create mode 100644 tests/.pest/snapshots/Countries/LuxembourgTest/it_can_calculate_luxembourgish_holidays.snap create mode 100644 tests/Countries/LuxembourgTest.php diff --git a/src/Countries/Luxembourg.php b/src/Countries/Luxembourg.php new file mode 100644 index 000000000..e5f73fd81 --- /dev/null +++ b/src/Countries/Luxembourg.php @@ -0,0 +1,39 @@ + '01-01', + 'Dag vun der Aarbecht' => '05-01', + 'Europadag' => '05-09', + 'Nationalfeierdag' => '06-23', + 'Mariä Himmelfahrt' => '08-15', + 'Allerhellgen' => '11-01', + 'Chrëschtdag' => '12-25', + 'Stiefesdag' => '12-26', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = $this->easter($year); + + return [ + 'Ouschterméindeg' => $easter->addDay(), + 'Christi Himmelfahrt' => $easter->addDays(39), + 'Péngschtméindeg' => $easter->addDays(50), + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/LuxembourgTest/it_can_calculate_luxembourgish_holidays.snap b/tests/.pest/snapshots/Countries/LuxembourgTest/it_can_calculate_luxembourgish_holidays.snap new file mode 100644 index 000000000..79f844c17 --- /dev/null +++ b/tests/.pest/snapshots/Countries/LuxembourgTest/it_can_calculate_luxembourgish_holidays.snap @@ -0,0 +1,46 @@ +[ + { + "name": "Neijoerschdag", + "date": "2024-01-01" + }, + { + "name": "Ouschterm\u00e9indeg", + "date": "2024-04-01" + }, + { + "name": "Dag vun der Aarbecht", + "date": "2024-05-01" + }, + { + "name": "Europadag", + "date": "2024-05-09" + }, + { + "name": "Christi Himmelfahrt", + "date": "2024-05-09" + }, + { + "name": "P\u00e9ngschtm\u00e9indeg", + "date": "2024-05-20" + }, + { + "name": "Nationalfeierdag", + "date": "2024-06-23" + }, + { + "name": "Mari\u00e4 Himmelfahrt", + "date": "2024-08-15" + }, + { + "name": "Allerhellgen", + "date": "2024-11-01" + }, + { + "name": "Chr\u00ebschtdag", + "date": "2024-12-25" + }, + { + "name": "Stiefesdag", + "date": "2024-12-26" + } +] \ No newline at end of file diff --git a/tests/Countries/LuxembourgTest.php b/tests/Countries/LuxembourgTest.php new file mode 100644 index 000000000..48c69782c --- /dev/null +++ b/tests/Countries/LuxembourgTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +});