-
-
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.
The Japanese Emperor will abdicate the throne on May 1st 2019. (#130)
The Japanese Emperor will abdicate the throne on May 1st 2019. Change Emperors Birthday to Feb 23th. Add Coronation Day And Enthronement Proclamation Ceremony.
- Loading branch information
1 parent
2e95813
commit 025843a
Showing
5 changed files
with
342 additions
and
9 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,105 @@ | ||
<?php | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2019 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\Japan; | ||
|
||
use DateTime; | ||
use DateTimeZone; | ||
use Yasumi\Holiday; | ||
use Yasumi\tests\YasumiTestCaseInterface; | ||
|
||
/** | ||
* Class testing the Emperors Coronation day in Japan. | ||
*/ | ||
class CoronationDayTest extends JapanBaseTestCase implements YasumiTestCaseInterface | ||
{ | ||
/** | ||
* The name of the holiday | ||
*/ | ||
public const HOLIDAY = 'coronationDay'; | ||
|
||
/** | ||
* The year in which the holiday was first established | ||
*/ | ||
public const ESTABLISHMENT_YEAR = 2019; | ||
|
||
/** | ||
* | ||
* | ||
* | ||
* @throws \Exception | ||
* @throws \ReflectionException | ||
*/ | ||
public function testEmperorsCoronationDay() | ||
{ | ||
$this->assertHoliday( | ||
self::REGION, | ||
self::HOLIDAY, | ||
2019, | ||
new DateTime("2019-5-1", new DateTimeZone(self::TIMEZONE)) | ||
); | ||
} | ||
|
||
|
||
/** | ||
* @throws \ReflectionException | ||
*/ | ||
public function testEmperorsBirthdayBefore2019() | ||
{ | ||
$this->assertNotHoliday( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1) | ||
); | ||
} | ||
|
||
/** | ||
* @throws \ReflectionException | ||
*/ | ||
public function testEmperorsBirthdayAfter2020() | ||
{ | ||
$this->assertNotHoliday( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$this->generateRandomYear(self::ESTABLISHMENT_YEAR + 1) | ||
); | ||
} | ||
|
||
|
||
/** | ||
* Tests the translated name of the holiday defined in this test. | ||
* @throws \ReflectionException | ||
*/ | ||
public function testTranslation(): void | ||
{ | ||
$this->assertTranslatedHolidayName( | ||
self::REGION, | ||
self::HOLIDAY, | ||
2019, | ||
[self::LOCALE => '即位の日'] | ||
); | ||
} | ||
|
||
/** | ||
* Tests type of the holiday defined in this test. | ||
* @throws \ReflectionException | ||
*/ | ||
public function testHolidayType(): void | ||
{ | ||
$this->assertHolidayType( | ||
self::REGION, | ||
self::HOLIDAY, | ||
2019, | ||
Holiday::TYPE_OFFICIAL | ||
); | ||
} | ||
} |
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,104 @@ | ||
<?php | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2019 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\Japan; | ||
|
||
use DateTime; | ||
use DateTimeZone; | ||
use Yasumi\Holiday; | ||
use Yasumi\tests\YasumiTestCaseInterface; | ||
|
||
/** | ||
* Class testing the Emperors Coronation day in Japan. | ||
*/ | ||
class EnthronementProclamationCeremonyTest extends JapanBaseTestCase implements YasumiTestCaseInterface | ||
{ | ||
/** | ||
* The name of the holiday | ||
*/ | ||
public const HOLIDAY = 'enthronementProclamationCeremony'; | ||
|
||
/** | ||
* The year in which the holiday was first established | ||
*/ | ||
public const IMPLEMENT_YEAR = 2019; | ||
|
||
/** | ||
* | ||
* | ||
* | ||
* @throws \Exception | ||
* @throws \ReflectionException | ||
*/ | ||
public function testEmperorsCoronationDay() | ||
{ | ||
$this->assertHoliday( | ||
self::REGION, | ||
self::HOLIDAY, | ||
2019, | ||
new DateTime("2019-10-22", new DateTimeZone(self::TIMEZONE)) | ||
); | ||
} | ||
|
||
|
||
/** | ||
* @throws \ReflectionException | ||
*/ | ||
public function testEmperorsBirthdayBefore2019() | ||
{ | ||
$this->assertNotHoliday( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$this->generateRandomYear(1000, self::IMPLEMENT_YEAR - 1) | ||
); | ||
} | ||
|
||
/** | ||
* @throws \ReflectionException | ||
*/ | ||
public function testEmperorsBirthdayAfter2020() | ||
{ | ||
$this->assertNotHoliday( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$this->generateRandomYear(self::IMPLEMENT_YEAR + 1) | ||
); | ||
} | ||
|
||
/** | ||
* Tests the translated name of the holiday defined in this test. | ||
* @throws \ReflectionException | ||
*/ | ||
public function testTranslation(): void | ||
{ | ||
$this->assertTranslatedHolidayName( | ||
self::REGION, | ||
self::HOLIDAY, | ||
2019, | ||
[self::LOCALE => '即位礼正殿の儀'] | ||
); | ||
} | ||
|
||
/** | ||
* Tests type of the holiday defined in this test. | ||
* @throws \ReflectionException | ||
*/ | ||
public function testHolidayType(): void | ||
{ | ||
$this->assertHolidayType( | ||
self::REGION, | ||
self::HOLIDAY, | ||
2019, | ||
Holiday::TYPE_OFFICIAL | ||
); | ||
} | ||
} |
Oops, something went wrong.