diff --git a/src/Countries/ElSalvador.php b/src/Countries/ElSalvador.php new file mode 100644 index 000000000..a8e6a9f3e --- /dev/null +++ b/src/Countries/ElSalvador.php @@ -0,0 +1,41 @@ + '01-01', + 'Día del Trabajo' => '05-01', + 'Día de la Madre' => '05-10', + 'Día del Padre' => '06-17', + 'Fiesta Divino Salvador del Mundo' => '08-06', + 'Día de la Independencia' => '09-15', + 'Día de Los Difuntos' => '11-02', + 'Navidad' => '12-25', + ], $this->variableHolidays($year)); + } + + /** @return arraysetTimezone('America/El_Salvador'); + + return [ + 'Jueves Santo' => $easter->subDays(3), + 'Viernes Santo' => $easter->subDays(2), + 'Sábado de Gloria' => $easter->subDays(1), + ]; + } +} diff --git a/tests/.pest/snapshots/Countries/ElSalvadorTest/it_can_calculate_el_salvador_holidays.snap b/tests/.pest/snapshots/Countries/ElSalvadorTest/it_can_calculate_el_salvador_holidays.snap new file mode 100644 index 000000000..2586f7686 --- /dev/null +++ b/tests/.pest/snapshots/Countries/ElSalvadorTest/it_can_calculate_el_salvador_holidays.snap @@ -0,0 +1,46 @@ +[ + { + "name": "A\u00f1o Nuevo", + "date": "2024-01-01" + }, + { + "name": "Jueves Santo", + "date": "2024-03-27" + }, + { + "name": "Viernes Santo", + "date": "2024-03-28" + }, + { + "name": "S\u00e1bado de Gloria", + "date": "2024-03-29" + }, + { + "name": "D\u00eda del Trabajo", + "date": "2024-05-01" + }, + { + "name": "D\u00eda de la Madre", + "date": "2024-05-10" + }, + { + "name": "D\u00eda del Padre", + "date": "2024-06-17" + }, + { + "name": "Fiesta Divino Salvador del Mundo", + "date": "2024-08-06" + }, + { + "name": "D\u00eda de la Independencia", + "date": "2024-09-15" + }, + { + "name": "D\u00eda de Los Difuntos", + "date": "2024-11-02" + }, + { + "name": "Navidad", + "date": "2024-12-25" + } +] \ No newline at end of file diff --git a/tests/Countries/ElSalvadorTest.php b/tests/Countries/ElSalvadorTest.php new file mode 100644 index 000000000..892a8f791 --- /dev/null +++ b/tests/Countries/ElSalvadorTest.php @@ -0,0 +1,18 @@ +get(); + + expect($holidays) + ->toBeArray() + ->not()->toBeEmpty(); + + expect(formatDates($holidays))->toMatchSnapshot(); +});