Skip to content

Commit 38a6850

Browse files
committed
テスト追加 - 2024/2025 祝日データ一致チェック
1 parent 3076e69 commit 38a6850

File tree

4 files changed

+54
-1
lines changed

4 files changed

+54
-1
lines changed

tests/data/2024.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"2024-01-01": "元日",
3+
"2024-01-08": "成人の日",
4+
"2024-02-11": "建国記念の日",
5+
"2024-02-12": "建国記念の日 振替休日",
6+
"2024-02-23": "天皇誕生日",
7+
"2024-03-20": "春分の日",
8+
"2024-04-29": "昭和の日",
9+
"2024-05-03": "憲法記念日",
10+
"2024-05-04": "みどりの日",
11+
"2024-05-05": "こどもの日",
12+
"2024-05-06": "こどもの日 振替休日",
13+
"2024-07-15": "海の日",
14+
"2024-08-11": "山の日",
15+
"2024-08-12": "休日 山の日",
16+
"2024-09-16": "敬老の日",
17+
"2024-09-22": "秋分の日",
18+
"2024-09-23": "秋分の日 振替休日",
19+
"2024-10-14": "スポーツの日",
20+
"2024-11-03": "文化の日",
21+
"2024-11-04": "文化の日 振替休日",
22+
"2024-11-23": "勤労感謝の日"
23+
}

tests/data/2025.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"2025-01-01": "元日",
3+
"2025-01-13": "成人の日",
4+
"2025-02-11": "建国記念の日",
5+
"2025-02-23": "天皇誕生日",
6+
"2025-02-24": "天皇誕生日 振替休日",
7+
"2025-03-20": "春分の日",
8+
"2025-04-29": "昭和の日",
9+
"2025-05-03": "憲法記念日",
10+
"2025-05-04": "みどりの日",
11+
"2025-05-05": "こどもの日",
12+
"2025-05-06": "みどりの日 振替休日",
13+
"2025-07-21": "海の日",
14+
"2025-08-11": "山の日",
15+
"2025-09-15": "敬老の日",
16+
"2025-09-23": "秋分の日",
17+
"2025-10-13": "スポーツの日",
18+
"2025-11-03": "文化の日",
19+
"2025-11-23": "勤労感謝の日",
20+
"2025-11-24": "勤労感謝の日 振替休日"
21+
}
File renamed without changes.

tests/holidaysJPTest.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class holidaysJPTest extends TestCase
1616
public function testICALAnalyze()
1717
{
1818
// サンプル ical データの解析テスト
19-
$test_file = __DIR__ . '/testdata.ics';
19+
$test_file = __DIR__ . '/data/testdata.ics';
2020
$holidays = new holidaysJP($test_file);
2121
$data = $holidays->get_holidays($holidays->get_ical_data());
2222

@@ -57,6 +57,15 @@ public function testGenerator()
5757
$this->checkApiFile("{$nextyear}/datetime.json", $nextyear, true);
5858
$this->checkApiFile("{$nextyear}/date.csv", $nextyear);
5959
$this->checkApiFile("{$nextyear}/datetime.csv", $nextyear, true);
60+
61+
// 2024/2025 ファイル一致チェック
62+
$file1 = file_get_contents(__DIR__ . '/data/2024.json');
63+
$file2 = file_get_contents(dirname(__DIR__) . '/docs/v1/2024/date.json');
64+
$this->assertEquals($file1, $file2);
65+
66+
$file1 = file_get_contents(__DIR__ . '/data/2025.json');
67+
$file2 = file_get_contents(dirname(__DIR__) . '/docs/v1/2025/date.json');
68+
$this->assertEquals($file1, $file2);
6069
}
6170

6271
/**

0 commit comments

Comments
 (0)