Skip to content

Commit

Permalink
Add Saint George's Day
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Telgenhof <me@sachatelgenhof.com>
  • Loading branch information
stelgenhof committed Dec 23, 2024
1 parent 3355069 commit 4b72cd6
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Yasumi/Provider/Bulgaria.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
57 changes: 57 additions & 0 deletions tests/Bulgaria/stGeorgesDayTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?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 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
);
}
}

0 comments on commit 4b72cd6

Please sign in to comment.