Skip to content

Commit e7b3392

Browse files
committed
feat: Add Assumption of Mary holiday to Bavaria (Germany)
Signed-off-by: Sacha Telgenhof <[email protected]>
1 parent 7447553 commit e7b3392

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

src/Yasumi/Provider/Germany/Bavaria.php

+1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@ public function initialize(): void
5050
$this->addHoliday($this->epiphany($this->year, $this->timezone, $this->locale));
5151
$this->addHoliday($this->corpusChristi($this->year, $this->timezone, $this->locale, Holiday::TYPE_OFFICIAL));
5252
$this->addHoliday($this->allSaintsDay($this->year, $this->timezone, $this->locale));
53+
$this->addHoliday($this->assumptionOfMary($this->year, $this->timezone, $this->locale, Holiday::TYPE_OTHER));
5354
}
5455
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
/**
6+
* This file is part of the 'Yasumi' package.
7+
*
8+
* The easy PHP Library for calculating holidays.
9+
*
10+
* Copyright (c) 2015 - 2024 AzuyaLabs
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
14+
*
15+
* @author Sacha Telgenhof <me at sachatelgenhof dot com>
16+
*/
17+
18+
namespace Yasumi\tests\Germany\Bavaria;
19+
20+
use Yasumi\Holiday;
21+
use Yasumi\tests\HolidayTestCase;
22+
23+
/**
24+
* Class for testing the day of the Assumption of Mary in Bavaria (Germany).
25+
*/
26+
class AssumptionOfMaryTest extends BavariaBaseTestCase implements HolidayTestCase
27+
{
28+
/**
29+
* The name of the holiday.
30+
*/
31+
public const HOLIDAY = 'assumptionOfMary';
32+
33+
/**
34+
* Tests the holiday defined in this test.
35+
*
36+
* @dataProvider HolidayDataProvider
37+
*
38+
* @param int $year the year for which the holiday defined in this test needs to be tested
39+
* @param \DateTime $expected the expected date
40+
*/
41+
public function testHoliday(int $year, \DateTimeInterface $expected): void
42+
{
43+
$this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected);
44+
}
45+
46+
/**
47+
* Returns a list of random test dates used for assertion of the holiday defined in this test.
48+
*
49+
* @return array<array> list of test dates for the holiday defined in this test
50+
*
51+
* @throws \Exception
52+
*/
53+
public function HolidayDataProvider(): array
54+
{
55+
return $this->generateRandomDates(8, 15, self::TIMEZONE);
56+
}
57+
58+
/**
59+
* Tests translated name of the Assumption of Mary.
60+
*
61+
* @throws \Exception
62+
*/
63+
public function testTranslation(): void
64+
{
65+
$this->assertTranslatedHolidayName(
66+
self::REGION,
67+
self::HOLIDAY,
68+
$this->generateRandomYear(),
69+
[self::LOCALE => 'Mariä Himmelfahrt']
70+
);
71+
}
72+
73+
/**
74+
* Tests type of the holiday defined in this test.
75+
*
76+
* @throws \Exception
77+
*/
78+
public function testHolidayType(): void
79+
{
80+
$this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OTHER);
81+
}
82+
}

0 commit comments

Comments
 (0)