xref: /webtrees/tests/app/Census/CensusOfSlovakiaTest.php (revision 5a8afed46297e8105e3e5a33ce37e6a8e88bc79d)
1c18c4744SGreg Roach<?php
2c18c4744SGreg Roach
3c18c4744SGreg Roach/**
4c18c4744SGreg Roach * webtrees: online genealogy
5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
6c18c4744SGreg Roach * This program is free software: you can redistribute it and/or modify
7c18c4744SGreg Roach * it under the terms of the GNU General Public License as published by
8c18c4744SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9c18c4744SGreg Roach * (at your option) any later version.
10c18c4744SGreg Roach * This program is distributed in the hope that it will be useful,
11c18c4744SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12c18c4744SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13c18c4744SGreg Roach * GNU General Public License for more details.
14c18c4744SGreg Roach * You should have received a copy of the GNU General Public License
1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16c18c4744SGreg Roach */
17c18c4744SGreg Roach
18c18c4744SGreg Roachdeclare(strict_types=1);
19c18c4744SGreg Roach
20c18c4744SGreg Roachnamespace Fisharebest\Webtrees\Census;
21c18c4744SGreg Roach
22c18c4744SGreg Roachuse Fisharebest\Webtrees\TestCase;
23*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass;
24c18c4744SGreg Roach
25*202c018bSGreg Roach#[CoversClass(CensusOfSlovakia::class)]
26c18c4744SGreg Roachclass CensusOfSlovakiaTest extends TestCase
27c18c4744SGreg Roach{
28c18c4744SGreg Roach    /**
29c18c4744SGreg Roach     * Test the census place
30c18c4744SGreg Roach     */
31c18c4744SGreg Roach    public function testPlace(): void
32c18c4744SGreg Roach    {
33c18c4744SGreg Roach        $census = new CensusOfSlovakia();
34c18c4744SGreg Roach
355e933c21SGreg Roach        self::assertSame('Slovensko', $census->censusPlace());
36c18c4744SGreg Roach    }
37c18c4744SGreg Roach
38c18c4744SGreg Roach    /**
39d5b0584dSGreg Roach     * Test the census language
40d5b0584dSGreg Roach     */
41d5b0584dSGreg Roach    public function testLanguage(): void
42d5b0584dSGreg Roach    {
43d5b0584dSGreg Roach        $census = new CensusOfSlovakia();
44d5b0584dSGreg Roach
455e933c21SGreg Roach        self::assertSame('sk', $census->censusLanguage());
46d5b0584dSGreg Roach    }
47d5b0584dSGreg Roach
48d5b0584dSGreg Roach    /**
49c18c4744SGreg Roach     * Test the census dates
50c18c4744SGreg Roach     */
51c18c4744SGreg Roach    public function testAllDates(): void
52c18c4744SGreg Roach    {
53c18c4744SGreg Roach        $census = new CensusOfSlovakia();
54c18c4744SGreg Roach
55c18c4744SGreg Roach        $census_dates = $census->allCensusDates();
56c18c4744SGreg Roach
5719968c02SGreg Roach        self::assertCount(3, $census_dates);
585e933c21SGreg Roach        self::assertInstanceOf(CensusOfSlovakia1869::class, $census_dates[0]);
5919968c02SGreg Roach        self::assertInstanceOf(CensusOfSlovakia1930::class, $census_dates[1]);
6019968c02SGreg Roach        self::assertInstanceOf(CensusOfSlovakia1940::class, $census_dates[2]);
61c18c4744SGreg Roach    }
62c18c4744SGreg Roach}
63