From de1d7ef89bbbbf782748cf7d036d5fcd302527b7 Mon Sep 17 00:00:00 2001 From: Hammad Zafar Date: Fri, 19 Jan 2024 16:17:41 +0500 Subject: [PATCH] Add Pakistan Holidays --- src/Countries/Pakistan.php | 39 +++++++++++++++++++ .../it_can_calculate_pakistan_holidays.snap | 26 +++++++++++++ tests/Countries/PakistanTest.php | 18 +++++++++ 3 files changed, 83 insertions(+) create mode 100644 src/Countries/Pakistan.php create mode 100644 tests/.pest/snapshots/Countries/PakistanTest/it_can_calculate_pakistan_holidays.snap create mode 100644 tests/Countries/PakistanTest.php diff --git a/src/Countries/Pakistan.php b/src/Countries/Pakistan.php new file mode 100644 index 000000000..3f641d7fc --- /dev/null +++ b/src/Countries/Pakistan.php @@ -0,0 +1,39 @@ + '02-05', + 'Pakistan Resolution Day' => '03-23', + 'Labour Day' => '05-01', + 'Independence Day' => '08-14', + 'Iqbal Day' => '11-09', + 'Quaid-e-Azam Day' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + // As Islamic holidays are lunar based. + // https://github.com/spatie/holidays/discussions/79 + + return []; + } +} diff --git a/tests/.pest/snapshots/Countries/PakistanTest/it_can_calculate_pakistan_holidays.snap b/tests/.pest/snapshots/Countries/PakistanTest/it_can_calculate_pakistan_holidays.snap new file mode 100644 index 000000000..c905d06d7 --- /dev/null +++ b/tests/.pest/snapshots/Countries/PakistanTest/it_can_calculate_pakistan_holidays.snap @@ -0,0 +1,26 @@ +[ + { + "name": "Kashmir Solidarity Day", + "date": "2024-02-05" + }, + { + "name": "Pakistan Resolution Day", + "date": "2024-03-23" + }, + { + "name": "Labour Day", + "date": "2024-05-01" + }, + { + "name": "Independence Day", + "date": "2024-08-14" + }, + { + "name": "Iqbal Day", + "date": "2024-11-09" + }, + { + "name": "Quaid-e-Azam Day", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/PakistanTest.php b/tests/Countries/PakistanTest.php new file mode 100644 index 000000000..8f8695f3f --- /dev/null +++ b/tests/Countries/PakistanTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +});