diff --git a/src/Countries/Angola.php b/src/Countries/Angola.php new file mode 100644 index 000000000..e83aa55ed --- /dev/null +++ b/src/Countries/Angola.php @@ -0,0 +1,42 @@ + '01-01', + 'Dia do Inicio da Luta Armada de Libertação Nacional' => '02-04', + 'Dia Internacional da Mulher' => '03-08', + 'Dia da Paz' => '04-04', + 'Dia Internacional do Trabalhador' => '05-01', + 'Dia do Fundador da Nação e do Herói Nacional' => '09-17', + 'Dia dos Finados' => '11-02', + 'Dia da Independência Nacional' => '11-11', + 'Dia do Natal' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return array */ + protected function variableHolidays(int $year): array + { + $easter = CarbonImmutable::createFromTimestamp(easter_date($year)) + ->setTimezone('Africa/Luanda'); + + return [ + 'Carnaval' => $easter->subDays(47), + 'Sexta Feira Santa' => $easter->subDays(2), + 'Páscoa' => $easter, + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/AngolaTest/it_can_calculate_angola_holidays.snap b/tests/.pest/snapshots/Countries/AngolaTest/it_can_calculate_angola_holidays.snap new file mode 100644 index 000000000..a97d32a98 --- /dev/null +++ b/tests/.pest/snapshots/Countries/AngolaTest/it_can_calculate_angola_holidays.snap @@ -0,0 +1,50 @@ +[ + { + "name": "Dia de Ano Novo", + "date": "2024-01-01" + }, + { + "name": "Dia do Inicio da Luta Armada de Liberta\u00e7\u00e3o Nacional", + "date": "2024-02-04" + }, + { + "name": "Carnaval", + "date": "2024-02-13" + }, + { + "name": "Dia Internacional da Mulher", + "date": "2024-03-08" + }, + { + "name": "Sexta Feira Santa", + "date": "2024-03-29" + }, + { + "name": "P\u00e1scoa", + "date": "2024-03-31" + }, + { + "name": "Dia da Paz", + "date": "2024-04-04" + }, + { + "name": "Dia Internacional do Trabalhador", + "date": "2024-05-01" + }, + { + "name": "Dia do Fundador da Na\u00e7\u00e3o e do Her\u00f3i Nacional", + "date": "2024-09-17" + }, + { + "name": "Dia dos Finados", + "date": "2024-11-02" + }, + { + "name": "Dia da Independ\u00eancia Nacional", + "date": "2024-11-11" + }, + { + "name": "Dia do Natal", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/AngolaTest.php b/tests/Countries/AngolaTest.php new file mode 100644 index 000000000..ae0e07518 --- /dev/null +++ b/tests/Countries/AngolaTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +});