-
-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathChristmasTest.php
84 lines (76 loc) · 2.04 KB
/
ChristmasTest.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
<?php
declare(strict_types=1);
/*
* This file is part of the Yasumi package.
*
* Copyright (c) 2015 - 2021 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Sacha Telgenhof <me@sachatelgenhof.com>
*/
namespace Yasumi\tests\Portugal;
use DateTime;
use Exception;
use ReflectionException;
use Yasumi\Holiday;
use Yasumi\tests\HolidayTestCase;
/**
* Class for testing Christmas in Portugal.
*/
class ChristmasTest extends PortugalBaseTestCase implements HolidayTestCase
{
/**
* The name of the holiday.
*/
public const HOLIDAY = 'christmasDay';
/**
* Tests Christmas Day.
*
* @dataProvider ChristmasDayDataProvider
*
* @param int $year the year for which Christmas Day needs to be tested
* @param DateTime $expected the expected date
*
* @throws ReflectionException
*/
public function testChristmasDay(int $year, DateTime $expected): void
{
$this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected);
}
/**
* Returns a list of random test dates used for assertion of Christmas Day.
*
* @return array list of test dates for Christmas Day
*
* @throws Exception
*/
public function ChristmasDayDataProvider(): array
{
return $this->generateRandomDates(12, 25, self::TIMEZONE);
}
/**
* Tests translated name of Christmas Day.
*
* @throws ReflectionException
*/
public function testTranslation(): void
{
$this->assertTranslatedHolidayName(
self::REGION,
self::HOLIDAY,
$this->generateRandomYear(),
[self::LOCALE => 'Natal']
);
}
/**
* Tests type of the holiday defined in this test.
*
* @throws ReflectionException
*/
public function testHolidayType(): void
{
$this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OFFICIAL);
}
}