xref: /webtrees/tests/app/Census/CensusOfCzechRepublic1921Test.php (revision 5a8afed46297e8105e3e5a33ce37e6a8e88bc79d)
1c2a8c8bfSGreg Roach<?php
23976b470SGreg Roach
3c2a8c8bfSGreg Roach/**
4c2a8c8bfSGreg Roach * webtrees: online genealogy
5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
6c2a8c8bfSGreg Roach * This program is free software: you can redistribute it and/or modify
7c2a8c8bfSGreg Roach * it under the terms of the GNU General Public License as published by
8c2a8c8bfSGreg Roach * the Free Software Foundation, either version 3 of the License, or
9c2a8c8bfSGreg Roach * (at your option) any later version.
10c2a8c8bfSGreg Roach * This program is distributed in the hope that it will be useful,
11c2a8c8bfSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12c2a8c8bfSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13c2a8c8bfSGreg Roach * GNU General Public License for more details.
14c2a8c8bfSGreg 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/>.
16c2a8c8bfSGreg Roach */
17fcfa147eSGreg Roach
18e7f56f2aSGreg Roachdeclare(strict_types=1);
19e7f56f2aSGreg Roach
20c2a8c8bfSGreg Roachnamespace Fisharebest\Webtrees\Census;
21c2a8c8bfSGreg Roach
223cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase;
23*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass;
243cfcc809SGreg Roach
25*202c018bSGreg Roach#[CoversClass(CensusOfCzechRepublic1921::class)]
26*202c018bSGreg Roach#[CoversClass(AbstractCensusColumn::class)]
273cfcc809SGreg Roachclass CensusOfCzechRepublic1921Test extends TestCase
28c1010edaSGreg Roach{
29c2a8c8bfSGreg Roach    /**
30c2a8c8bfSGreg Roach     * Test the census place and date
31c2a8c8bfSGreg Roach     */
329b802b22SGreg Roach    public function testPlaceAndDate(): void
33c1010edaSGreg Roach    {
3474d6dc0eSGreg Roach        $census = new CensusOfCzechRepublic1921();
35c2a8c8bfSGreg Roach
365e933c21SGreg Roach        self::assertSame('Česko', $census->censusPlace());
375e933c21SGreg Roach        self::assertSame('15 FEB 1921', $census->censusDate());
38c2a8c8bfSGreg Roach    }
39c2a8c8bfSGreg Roach
40c2a8c8bfSGreg Roach    /**
41c2a8c8bfSGreg Roach     * Test the census columns
42c2a8c8bfSGreg Roach     */
439b802b22SGreg Roach    public function testColumns(): void
44c1010edaSGreg Roach    {
4574d6dc0eSGreg Roach        $census  = new CensusOfCzechRepublic1921();
46c2a8c8bfSGreg Roach        $columns = $census->columns();
47c2a8c8bfSGreg Roach
48720ec754SGreg Roach        self::assertCount(20, $columns);
49720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[0]);
50720ec754SGreg Roach        self::assertInstanceOf(CensusColumnSurname::class, $columns[1]);
51720ec754SGreg Roach        self::assertInstanceOf(CensusColumnGivenNames::class, $columns[2]);
52720ec754SGreg Roach        self::assertInstanceOf(CensusColumnRelationToHead::class, $columns[3]);
53720ec754SGreg Roach        self::assertInstanceOf(CensusColumnSexMZ::class, $columns[4]);
54720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[5]);
55720ec754SGreg Roach        self::assertInstanceOf(CensusColumnBirthDayDotMonthYear::class, $columns[6]);
56720ec754SGreg Roach        self::assertInstanceOf(CensusColumnBirthPlace::class, $columns[7]);
57720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[8]);
585e933c21SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[9]);
59720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[10]);
60720ec754SGreg Roach        self::assertInstanceOf(CensusColumnReligion::class, $columns[11]);
615e933c21SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[12]);
62720ec754SGreg Roach        self::assertInstanceOf(CensusColumnOccupation::class, $columns[13]);
63720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[14]);
64720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[15]);
65720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[16]);
66720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[17]);
67720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[18]);
68720ec754SGreg Roach        self::assertInstanceOf(CensusColumnNull::class, $columns[19]);
69c2a8c8bfSGreg Roach
70720ec754SGreg Roach        self::assertSame('Ř.č.', $columns[0]->abbreviation());
71720ec754SGreg Roach        self::assertSame('Příjmení', $columns[1]->abbreviation());
72720ec754SGreg Roach        self::assertSame('Jméno', $columns[2]->abbreviation());
73720ec754SGreg Roach        self::assertSame('Vztah', $columns[3]->abbreviation());
74720ec754SGreg Roach        self::assertSame('Pohlaví', $columns[4]->abbreviation());
75720ec754SGreg Roach        self::assertSame('Stav', $columns[5]->abbreviation());
76720ec754SGreg Roach        self::assertSame('Narození', $columns[6]->abbreviation());
77720ec754SGreg Roach        self::assertSame('Rodiště', $columns[7]->abbreviation());
78720ec754SGreg Roach        self::assertSame('Bydlí od', $columns[8]->abbreviation());
79720ec754SGreg Roach        self::assertSame('Přísluší', $columns[9]->abbreviation());
80720ec754SGreg Roach        self::assertSame('Národnost', $columns[10]->abbreviation());
81720ec754SGreg Roach        self::assertSame('Vyznání', $columns[11]->abbreviation());
82720ec754SGreg Roach        self::assertSame('Gramotnost', $columns[12]->abbreviation());
83720ec754SGreg Roach        self::assertSame('Povolání', $columns[13]->abbreviation());
84720ec754SGreg Roach        self::assertSame('Postavení', $columns[14]->abbreviation());
85720ec754SGreg Roach        self::assertSame('Podnik', $columns[15]->abbreviation());
86720ec754SGreg Roach        self::assertSame('Měl povolání 1914', $columns[16]->abbreviation());
87720ec754SGreg Roach        self::assertSame('Povolání 1914', $columns[17]->abbreviation());
88720ec754SGreg Roach        self::assertSame('Postavení 1914', $columns[18]->abbreviation());
89720ec754SGreg Roach        self::assertSame('Poznámka', $columns[19]->abbreviation());
90c2a8c8bfSGreg Roach
91720ec754SGreg Roach        self::assertSame('Řadové číslo', $columns[0]->title());
92720ec754SGreg Roach        self::assertSame('jméno rodinné', $columns[1]->title());
93720ec754SGreg Roach        self::assertSame('Jméno (křestni)', $columns[2]->title());
94720ec754SGreg Roach        self::assertSame('', $columns[3]->title());
95720ec754SGreg Roach        self::assertSame('', $columns[4]->title());
96720ec754SGreg Roach        self::assertSame('Rodinný stav', $columns[5]->title());
97720ec754SGreg Roach        self::assertSame('Datum narození', $columns[6]->title());
98720ec754SGreg Roach        self::assertSame('Rodná obec, Soudní okres, Země', $columns[7]->title());
99720ec754SGreg Roach        self::assertSame('Od kdy bydlí zapsána osoba v obci?', $columns[8]->title());
100720ec754SGreg Roach        self::assertSame('Domovské právo', $columns[9]->title());
101720ec754SGreg Roach        self::assertSame('Mateřský jazyk', $columns[10]->title());
102720ec754SGreg Roach        self::assertSame('', $columns[11]->title());
103720ec754SGreg Roach        self::assertSame('Znalost čtení a psaní', $columns[12]->title());
104720ec754SGreg Roach        self::assertSame('Druh povolání', $columns[13]->title());
105720ec754SGreg Roach        self::assertSame('Postavení v zaměstnání', $columns[14]->title());
106720ec754SGreg Roach        self::assertSame('', $columns[15]->title());
107720ec754SGreg Roach        self::assertSame('', $columns[16]->title());
108720ec754SGreg Roach        self::assertSame('Druh povolání dne 16. července 1914', $columns[17]->title());
109720ec754SGreg Roach        self::assertSame('Postavení v zaměstnání dne 16. července 1914', $columns[18]->title());
110720ec754SGreg Roach        self::assertSame('', $columns[19]->title());
111c2a8c8bfSGreg Roach    }
112c2a8c8bfSGreg Roach}
113