Skip to content

Commit

Permalink
test: add switzerland test
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Welte committed Jan 21, 2024
1 parent ae9e18d commit 4c006cb
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"name": "Neujahr",
"date": "2024-01-01"
},
{
"name": "Berchtoldstag",
"date": "2024-01-02"
},
{
"name": "Karfreitag",
"date": "2024-03-29"
},
{
"name": "Ostermontag",
"date": "2024-04-01"
},
{
"name": "Auffahrt",
"date": "2024-05-09"
},
{
"name": "Pfingstmontag",
"date": "2024-05-20"
},
{
"name": "Bundesfeier",
"date": "2024-08-01"
},
{
"name": "Weihnachtstag",
"date": "2024-12-25"
},
{
"name": "Stephanstag",
"date": "2024-12-26"
}
]
18 changes: 18 additions & 0 deletions tests/Countries/SwitzerlandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Spatie\Holidays\Tests\Countries;

use Carbon\CarbonImmutable;
use Spatie\Holidays\Holidays;

it('can calculate swiss holidays', function () {
CarbonImmutable::setTestNowAndTimezone('2024-01-01');

$holidays = Holidays::for(country: 'ch')->get();

expect($holidays)
->toBeArray()
->not()->toBeEmpty();

expect(formatDates($holidays))->toMatchSnapshot();
});

0 comments on commit 4c006cb

Please sign in to comment.