-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 2017 reformation day for Germany
Fix #135
- Loading branch information
1 parent
6020c1a
commit b8f201a
Showing
2 changed files
with
35 additions
and
0 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
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 DeTest 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('de-national'); | ||
|
||
self::assertFalse($carbon::parse('2024-03-31')->getHolidayName()); | ||
self::assertFalse($carbon::parse('2024-10-31')->getHolidayName()); | ||
self::assertSame('Reformation Day', $carbon::parse('2017-10-31')->getHolidayName()); | ||
|
||
$carbon::resetHolidays(); | ||
$carbon::setHolidaysRegion('de-bb'); | ||
|
||
self::assertSame('Easter', $carbon::parse('2024-03-31')->getHolidayName()); | ||
} | ||
} |