forked from azuyalabs/yasumi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatehoodDayTest.php
100 lines (91 loc) · 2.51 KB
/
StatehoodDayTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php declare(strict_types=1);
/**
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2020 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Sacha Telgenhof <[email protected]>
*/
namespace Yasumi\tests\Lithuania;
use DateTime;
use DateTimeZone;
use Exception;
use ReflectionException;
use Yasumi\Holiday;
use Yasumi\Provider\Lithuania;
use Yasumi\tests\YasumiTestCaseInterface;
/**
* Class containing tests for Statehood Day day in Lithuania.
*
* @author Gedas Lukošius <[email protected]>
*/
class StatehoodDayTest extends LithuaniaBaseTestCase implements YasumiTestCaseInterface
{
/**
* The name of the holiday to be tested
*/
public const HOLIDAY = 'statehoodDay';
/**
* Test if holiday is not defined before restoration
* @throws ReflectionException
*/
public function testHolidayBeforeRestoration()
{
$this->assertNotHoliday(
self::REGION,
self::HOLIDAY,
$this->generateRandomYear(1000, Lithuania::STATEHOOD_YEAR - 1)
);
}
/**
* Test if holiday is defined after restoration
* @throws Exception
* @throws ReflectionException
*/
public function testHolidayAfterRestoration()
{
$year = $this->generateRandomYear(Lithuania::STATEHOOD_YEAR);
$this->assertHoliday(
self::REGION,
self::HOLIDAY,
$year,
new DateTime("{$year}-07-06", new DateTimeZone(self::TIMEZONE))
);
}
/**
* {@inheritdoc}
*
* @throws ReflectionException
*/
public function testTranslation(): void
{
$this->assertTranslatedHolidayName(
self::REGION,
self::HOLIDAY,
$this->generateRandomYear(Lithuania::STATEHOOD_YEAR),
[self::LOCALE => 'Valstybės (Lietuvos karaliaus Mindaugo karūnavimo) diena']
);
$this->assertTranslatedHolidayName(
self::REGION,
self::HOLIDAY,
$this->generateRandomYear(Lithuania::STATEHOOD_YEAR),
['en' => 'Statehood Day (Lithuania)']
);
}
/**
* {@inheritdoc}
* @throws ReflectionException
*/
public function testHolidayType(): void
{
$this->assertHolidayType(
self::REGION,
self::HOLIDAY,
$this->generateRandomYear(Lithuania::STATEHOOD_YEAR),
Holiday::TYPE_OFFICIAL
);
}
}