-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
77 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
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,75 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2020 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <[email protected]> | ||
*/ | ||
|
||
namespace Yasumi\tests\Germany; | ||
|
||
use DateTime; | ||
use DateTimeZone; | ||
use Exception; | ||
use ReflectionException; | ||
use Yasumi\Holiday; | ||
use Yasumi\tests\YasumiTestCaseInterface; | ||
|
||
/** | ||
* Class for testing Pentecost in Germany. | ||
*/ | ||
class PentecostTest extends GermanyBaseTestCase implements YasumiTestCaseInterface | ||
{ | ||
/** | ||
* The name of the holiday | ||
*/ | ||
public const HOLIDAY = 'pentecost'; | ||
|
||
/** | ||
* Tests the holiday defined in this test. | ||
* @throws Exception | ||
* @throws ReflectionException | ||
*/ | ||
public function testHoliday() | ||
{ | ||
$year = $this->generateRandomYear(); | ||
$time_stamp = \strtotime( | ||
$year . '-03-21' . \easter_days($year) . ' day + 49 day' | ||
); | ||
$date = \date('Y-m-d', $time_stamp); | ||
|
||
$this->assertHoliday( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$year, | ||
new DateTime($date, new DateTimeZone(self::TIMEZONE)) | ||
); | ||
} | ||
|
||
/** | ||
* Tests the translated name of the holiday defined in this test. | ||
* @throws ReflectionException | ||
*/ | ||
public function testTranslation(): void | ||
{ | ||
$this->assertTranslatedHolidayName( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$this->generateRandomYear(), | ||
[self::LOCALE => 'Pfingstsonntag'] | ||
); | ||
} | ||
|
||
/** | ||
* Tests type of the holiday defined in this test. | ||
* @throws ReflectionException | ||
*/ | ||
public function testHolidayType(): void | ||
{ | ||
$this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL); | ||
} | ||
} |