From 4b72cd6d874fb7d4ba3d18f94dcfb75feed9e982 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sat, 2 Nov 2024 22:01:13 +0900 Subject: [PATCH] Add Saint George's Day Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/Bulgaria.php | 4 ++ tests/Bulgaria/stGeorgesDayTest.php | 57 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 tests/Bulgaria/stGeorgesDayTest.php diff --git a/src/Yasumi/Provider/Bulgaria.php b/src/Yasumi/Provider/Bulgaria.php index cfe96b515..b19c88416 100644 --- a/src/Yasumi/Provider/Bulgaria.php +++ b/src/Yasumi/Provider/Bulgaria.php @@ -81,6 +81,10 @@ public function initialize(): void 'bg' => 'Ден на Освобождението на България от османско иго', ], new \DateTime("{$this->year}-03-03", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } + + $this->addHoliday(new Holiday('stGeorgesDay', [ + 'bg' => 'Гергьовден, ден на храбростта и Българската армия', + ], new \DateTime("{$this->year}-05-06", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale)); } public function getSources(): array diff --git a/tests/Bulgaria/stGeorgesDayTest.php b/tests/Bulgaria/stGeorgesDayTest.php new file mode 100644 index 000000000..88a95c015 --- /dev/null +++ b/tests/Bulgaria/stGeorgesDayTest.php @@ -0,0 +1,57 @@ + + */ + +namespace Yasumi\tests\Bulgaria; + +use Yasumi\Holiday; +use Yasumi\tests\HolidayTestCase; + +class stGeorgesDayTest extends BulgariaBaseTestCase implements HolidayTestCase +{ + public const HOLIDAY = 'stGeorgesDay'; + + public function testHoliday(): void + { + $year = $this->generateRandomYear(); + $this->assertHoliday( + self::REGION, + self::HOLIDAY, + $year, + new \DateTime("{$year}-05-06", new \DateTimeZone(self::TIMEZONE)) + ); + } + + public function testTranslation(): void + { + $this->assertTranslatedHolidayName( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + [self::LOCALE => 'Гергьовден, ден на храбростта и Българската армия'] + ); + } + + public function testHolidayType(): void + { + $this->assertHolidayType( + self::REGION, + self::HOLIDAY, + $this->generateRandomYear(), + Holiday::TYPE_OFFICIAL + ); + } +}