Skip to content

Commit

Permalink
fix snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Jan 12, 2024
1 parent 6bc43b3 commit 8f6f757
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/Actions/Belgium.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Spatie\Holidays\Actions;

use Carbon\CarbonImmutable;
use Spatie\Holidays\Data\Holiday;
use Spatie\Holidays\Exceptions\HolidaysException;

class Belgium implements Executable
Expand Down
4 changes: 4 additions & 0 deletions src/Holidays.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public function country(string $countryCode): static
/** @return array<array{name: string, date: string} */
public function get(): array
{
if ($this->holidays === []) {
$this->calculate();
}

return $this->format($this->holidays);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"name": "Nieuwjaar",
"date": "01-01-2022"
},
{
"name": "Paasmaandag",
"date": "04-17-2022"
},
{
"name": "Dag van de Arbeid",
"date": "05-01-2022"
},
{
"name": "OH Hemelvaart",
"date": "05-25-2022"
},
{
"name": "Pinkstermaandag",
"date": "06-05-2022"
},
{
"name": "Nationale Feestdag",
"date": "07-21-2022"
},
{
"name": "OLV Hemelvaart",
"date": "08-15-2022"
},
{
"name": "Allerheiligen",
"date": "11-01-2022"
},
{
"name": "Wapenstilstand",
"date": "11-11-2022"
},
{
"name": "Kerstmis",
"date": "12-25-2022"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"name": "Nieuwjaar",
"date": "01-01-2024"
},
{
"name": "Paasmaandag",
"date": "03-31-2024"
},
{
"name": "Dag van de Arbeid",
"date": "05-01-2024"
},
{
"name": "OH Hemelvaart",
"date": "05-08-2024"
},
{
"name": "Pinkstermaandag",
"date": "05-19-2024"
},
{
"name": "Nationale Feestdag",
"date": "07-21-2024"
},
{
"name": "OLV Hemelvaart",
"date": "08-15-2024"
},
{
"name": "Allerheiligen",
"date": "11-01-2024"
},
{
"name": "Wapenstilstand",
"date": "11-11-2024"
},
{
"name": "Kerstmis",
"date": "12-25-2024"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@
"name": "Nieuwjaar",
"date": "01-01-2024"
},
{
"name": "Paasmaandag",
"date": "03-31-2024"
},
{
"name": "Dag van de Arbeid",
"date": "05-01-2024"
},
{
"name": "OH Hemelvaart",
"date": "05-08-2024"
},
{
"name": "Pinkstermaandag",
"date": "05-19-2024"
},
{
"name": "Nationale Feestdag",
"date": "07-21-2024"
Expand All @@ -26,17 +38,5 @@
{
"name": "Kerstmis",
"date": "12-25-2024"
},
{
"name": "Paasmaandag",
"date": "03-31-2024"
},
{
"name": "OH Hemelvaart",
"date": "05-08-2024"
},
{
"name": "Pinkstermaandag",
"date": "05-19-2024"
}
]
4 changes: 2 additions & 2 deletions tests/HolidaysTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
});

it('cannot get all holidays of an unknown country code', function () {
Holidays::new()->country('unknown')->get();
})->throws(HolidaysException::class, 'Please provide a country code.');
dd(Holidays::new()->country('unknown')->get());
})->throws(HolidaysException::class, 'Country code `unknown` is not supported');

it('cannot get holidays for years before 1970', function () {
Holidays::new()->year(1969)->get();
Expand Down

0 comments on commit 8f6f757

Please sign in to comment.