-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable Prayer Day in Denmark starting from 2024
- Loading branch information
1 parent
a623e6d
commit 62babf7
Showing
4 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Tests\Cmixin\Holidays; | ||
|
||
use Cmixin\BusinessDay; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class DkTest extends TestCase | ||
{ | ||
const CARBON_CLASS = 'Carbon\Carbon'; | ||
|
||
protected function setUp(): void | ||
{ | ||
BusinessDay::enable(static::CARBON_CLASS); | ||
$carbon = static::CARBON_CLASS; | ||
$carbon::resetHolidays(); | ||
} | ||
|
||
public function testHolidays(): void | ||
{ | ||
$carbon = static::CARBON_CLASS; | ||
$carbon::resetHolidays(); | ||
$carbon::setHolidaysRegion('dk-national'); | ||
|
||
self::assertTrue($carbon::parse('2023-05-05')->isHoliday()); | ||
self::assertSame('easter-26', $carbon::parse('2023-05-05')->getHolidayId()); | ||
self::assertSame('Prayer Day', $carbon::parse('2023-05-05')->getHolidayName()); | ||
self::assertSame('Store Bededag', $carbon::parse('2023-05-05')->getHolidayName('da')); | ||
self::assertFalse($carbon::parse('2024-04-26')->isHoliday()); | ||
self::assertFalse($carbon::parse('2024-04-26')->getHolidayId()); | ||
self::assertFalse($carbon::parse('2024-04-26')->getHolidayName()); | ||
self::assertFalse($carbon::parse('2024-04-26')->getHolidayName('da')); | ||
} | ||
} |