-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sacha Telgenhof <[email protected]>
- Loading branch information
1 parent
bf19eab
commit 5e84d12
Showing
4 changed files
with
85 additions
and
19 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,67 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
/** | ||
* This file is part of the 'Yasumi' package. | ||
* | ||
* The easy PHP Library for calculating holidays. | ||
* | ||
* Copyright (c) 2015 - 2024 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <me at sachatelgenhof dot com> | ||
*/ | ||
|
||
namespace Yasumi\tests\Bulgaria; | ||
|
||
use Yasumi\Holiday; | ||
use Yasumi\tests\HolidayTestCase; | ||
|
||
class LiberationDayTest extends BulgariaBaseTestCase implements HolidayTestCase | ||
{ | ||
public const HOLIDAY = 'liberationDay'; | ||
|
||
private const ESTABLISHMENT_YEAR = 1990; | ||
|
||
public function testHoliday(): void | ||
{ | ||
$year = self::ESTABLISHMENT_YEAR; | ||
$this->assertHoliday( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$year, | ||
new \DateTime("{$year}-03-03", new \DateTimeZone(self::TIMEZONE)) | ||
); | ||
} | ||
|
||
public function testNotHoliday(): void | ||
{ | ||
$this->assertNotHoliday(self::REGION, self::HOLIDAY, self::ESTABLISHMENT_YEAR - 1); | ||
} | ||
|
||
/** | ||
* @return array<array<int, \DateTime>> | ||
*/ | ||
public function HolidayDataProvider(): array | ||
{ | ||
return $this->generateRandomDates(3, 3, self::TIMEZONE, null, 2000); | ||
} | ||
|
||
public function testTranslation(): void | ||
{ | ||
$this->assertTranslatedHolidayName( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$this->generateRandomYear(self::ESTABLISHMENT_YEAR), | ||
[self::LOCALE => 'Ден на Освобождението на България от османско иго'] | ||
); | ||
} | ||
|
||
public function testHolidayType(): void | ||
{ | ||
$this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(self::ESTABLISHMENT_YEAR), 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