xref: /webtrees/tests/app/Census/CensusOfCzechRepublic1921Test.php (revision 71378461661e7642e52abe7d41c9cfffb3e5369b)
1c2a8c8bfSGreg Roach<?php
23976b470SGreg Roach
3c2a8c8bfSGreg Roach/**
4c2a8c8bfSGreg Roach * webtrees: online genealogy
58fcd0d32SGreg Roach * Copyright (C) 2019 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
15c2a8c8bfSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
16c2a8c8bfSGreg Roach */
17e7f56f2aSGreg Roachdeclare(strict_types=1);
18e7f56f2aSGreg Roach
19c2a8c8bfSGreg Roachnamespace Fisharebest\Webtrees\Census;
20c2a8c8bfSGreg Roach
21c2a8c8bfSGreg Roach/**
22c2a8c8bfSGreg Roach * Test harness for the class CensusOfCzechRepublic1921
23c2a8c8bfSGreg Roach */
2484e2cf4eSGreg Roachclass CensusOfCzechRepublic1921Test extends \Fisharebest\Webtrees\TestCase
25c1010edaSGreg Roach{
26c2a8c8bfSGreg Roach    /**
27c2a8c8bfSGreg Roach     * Test the census place and date
28c2a8c8bfSGreg Roach     *
2915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921
3052348eb8SGreg Roach     *
3152348eb8SGreg Roach     * @return void
32c2a8c8bfSGreg Roach     */
339b802b22SGreg Roach    public function testPlaceAndDate(): void
34c1010edaSGreg Roach    {
3574d6dc0eSGreg Roach        $census = new CensusOfCzechRepublic1921();
36c2a8c8bfSGreg Roach
37c2a8c8bfSGreg Roach        $this->assertSame('Česko', $census->censusPlace());
38c2a8c8bfSGreg Roach        $this->assertSame('15 FEB 1921', $census->censusDate());
39c2a8c8bfSGreg Roach    }
40c2a8c8bfSGreg Roach
41c2a8c8bfSGreg Roach    /**
42c2a8c8bfSGreg Roach     * Test the census columns
43c2a8c8bfSGreg Roach     *
4415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921
4515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
4652348eb8SGreg Roach     *
4752348eb8SGreg Roach     * @return void
48c2a8c8bfSGreg Roach     */
499b802b22SGreg Roach    public function testColumns(): void
50c1010edaSGreg Roach    {
5174d6dc0eSGreg Roach        $census  = new CensusOfCzechRepublic1921();
52c2a8c8bfSGreg Roach        $columns = $census->columns();
53c2a8c8bfSGreg Roach
54c2a8c8bfSGreg Roach        $this->assertCount(14, $columns);
55*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnFullName::class, $columns[0]);
56*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[1]);
57*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnSexMZ::class, $columns[2]);
58*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[3]);
59*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnBirthDaySlashMonthYear::class, $columns[4]);
60*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnBirthPlace::class, $columns[5]);
61*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[6]);
62*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[7]);
63*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnReligion::class, $columns[8]);
64*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[9]);
65*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnOccupation::class, $columns[10]);
66*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[11]);
67*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[12]);
68*71378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[13]);
69c2a8c8bfSGreg Roach
70c2a8c8bfSGreg Roach        $this->assertSame('Jméno', $columns[0]->abbreviation());
71c2a8c8bfSGreg Roach        $this->assertSame('Vztah', $columns[1]->abbreviation());
72c2a8c8bfSGreg Roach        $this->assertSame('Pohlaví', $columns[2]->abbreviation());
73c2a8c8bfSGreg Roach        $this->assertSame('Stav', $columns[3]->abbreviation());
74c2a8c8bfSGreg Roach        $this->assertSame('Narození', $columns[4]->abbreviation());
75c2a8c8bfSGreg Roach        $this->assertSame('Místo', $columns[5]->abbreviation());
76c2a8c8bfSGreg Roach        $this->assertSame('Přísluší', $columns[6]->abbreviation());
77fbf0a249SGreg Roach        $this->assertSame('Národnost', $columns[7]->abbreviation());
78c2a8c8bfSGreg Roach        $this->assertSame('Vyznání', $columns[8]->abbreviation());
79fbf0a249SGreg Roach        $this->assertSame('Gramotnost', $columns[9]->abbreviation());
80fbf0a249SGreg Roach        $this->assertSame('Povolání', $columns[10]->abbreviation());
81fbf0a249SGreg Roach        $this->assertSame('Postavení', $columns[11]->abbreviation());
82fbf0a249SGreg Roach        $this->assertSame('Podnik', $columns[12]->abbreviation());
83c2a8c8bfSGreg Roach        $this->assertSame('', $columns[13]->abbreviation());
84c2a8c8bfSGreg Roach
85c2a8c8bfSGreg Roach        $this->assertSame('', $columns[0]->title());
86c2a8c8bfSGreg Roach        $this->assertSame('', $columns[1]->title());
87c2a8c8bfSGreg Roach        $this->assertSame('', $columns[2]->title());
88c2a8c8bfSGreg Roach        $this->assertSame('Rodinný stav', $columns[3]->title());
89c2a8c8bfSGreg Roach        $this->assertSame('Datum narození', $columns[4]->title());
90c2a8c8bfSGreg Roach        $this->assertSame('Místo narození', $columns[5]->title());
91c2a8c8bfSGreg Roach        $this->assertSame('Domovské právo', $columns[6]->title());
92fbf0a249SGreg Roach        $this->assertSame('Mateřský jazyk', $columns[7]->title());
93c2a8c8bfSGreg Roach        $this->assertSame('', $columns[8]->title());
94fbf0a249SGreg Roach        $this->assertSame('Znalost čtení a psaní', $columns[9]->title());
95fbf0a249SGreg Roach        $this->assertSame('', $columns[10]->title());
96fbf0a249SGreg Roach        $this->assertSame('Postavení v zaměstnání', $columns[11]->title());
97c2a8c8bfSGreg Roach        $this->assertSame('', $columns[12]->title());
98c2a8c8bfSGreg Roach        $this->assertSame('', $columns[13]->title());
99c2a8c8bfSGreg Roach    }
100c2a8c8bfSGreg Roach}
101