Skip to content

Commit

Permalink
Add Bulgarian Education and Culture and Slavonic Literature Day
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Telgenhof <[email protected]>
  • Loading branch information
stelgenhof committed Dec 23, 2024
1 parent 4b72cd6 commit 51be929
Show file tree
Hide file tree
Showing 3 changed files with 74 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 @@ -80,6 +80,10 @@ public function initialize(): void
$this->addHoliday(new Holiday('liberationDay', [
'bg' => 'Ден на Освобождението на България от османско иго',
], new \DateTime("{$this->year}-03-03", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale));

$this->addHoliday(new Holiday('educationCultureSlavonicLiteratureDay', [
'bg' => 'Ден на българската просвета и култура и на славянската писменост',
], new \DateTime("{$this->year}-05-24", DateTimeZoneFactory::getDateTimeZone($this->timezone)), $this->locale));
}

$this->addHoliday(new Holiday('stGeorgesDay', [
Expand Down
2 changes: 2 additions & 0 deletions tests/Bulgaria/BulgariaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ public function testOfficialHolidays(): void
$holidays = [
'newYearsDay',
'internationalWorkersDay',
'stGeorgesDay',
];

if ($this->year >= 1990) {
$holidays[] = 'liberationDay';
$holidays[] = 'educationCultureSlavonicLiteratureDay';
}

$this->assertDefinedHolidays($holidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL);
Expand Down
68 changes: 68 additions & 0 deletions tests/Bulgaria/EducationCultureSlavonicLiteratureDayTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?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 EducationCultureSlavonicLiteratureDayTest extends BulgariaBaseTestCase implements HolidayTestCase
{
public const HOLIDAY = 'educationCultureSlavonicLiteratureDay';

private const ESTABLISHMENT_YEAR = 1990;

public function testHoliday(): void
{
$year = $this->generateRandomYear(self::ESTABLISHMENT_YEAR);
$this->assertHoliday(
self::REGION,
self::HOLIDAY,
$year,
new \DateTime("{$year}-05-24", new \DateTimeZone(self::TIMEZONE))
);
}

public function testNotHoliday(): void
{
$this->assertNotHoliday(
self::REGION,
self::HOLIDAY,
$this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)
);
}

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
);
}
}

0 comments on commit 51be929

Please sign in to comment.