xref: /webtrees/tests/app/Census/CensusOfCzechRepublic1921Test.php (revision 3cfcc809af53e831fa6cafac7b274a2cb407db6e)
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
21*3cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase;
22*3cfcc809SGreg Roach
23c2a8c8bfSGreg Roach/**
24c2a8c8bfSGreg Roach * Test harness for the class CensusOfCzechRepublic1921
25c2a8c8bfSGreg Roach */
26*3cfcc809SGreg Roachclass CensusOfCzechRepublic1921Test extends TestCase
27c1010edaSGreg Roach{
28c2a8c8bfSGreg Roach    /**
29c2a8c8bfSGreg Roach     * Test the census place and date
30c2a8c8bfSGreg Roach     *
3115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921
3252348eb8SGreg Roach     *
3352348eb8SGreg Roach     * @return void
34c2a8c8bfSGreg Roach     */
359b802b22SGreg Roach    public function testPlaceAndDate(): void
36c1010edaSGreg Roach    {
3774d6dc0eSGreg Roach        $census = new CensusOfCzechRepublic1921();
38c2a8c8bfSGreg Roach
39c2a8c8bfSGreg Roach        $this->assertSame('Česko', $census->censusPlace());
40c2a8c8bfSGreg Roach        $this->assertSame('15 FEB 1921', $census->censusDate());
41c2a8c8bfSGreg Roach    }
42c2a8c8bfSGreg Roach
43c2a8c8bfSGreg Roach    /**
44c2a8c8bfSGreg Roach     * Test the census columns
45c2a8c8bfSGreg Roach     *
4615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921
4715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
4852348eb8SGreg Roach     *
4952348eb8SGreg Roach     * @return void
50c2a8c8bfSGreg Roach     */
519b802b22SGreg Roach    public function testColumns(): void
52c1010edaSGreg Roach    {
5374d6dc0eSGreg Roach        $census  = new CensusOfCzechRepublic1921();
54c2a8c8bfSGreg Roach        $columns = $census->columns();
55c2a8c8bfSGreg Roach
56c2a8c8bfSGreg Roach        $this->assertCount(14, $columns);
5771378461SGreg Roach        $this->assertInstanceOf(CensusColumnFullName::class, $columns[0]);
5871378461SGreg Roach        $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[1]);
5971378461SGreg Roach        $this->assertInstanceOf(CensusColumnSexMZ::class, $columns[2]);
6071378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[3]);
6171378461SGreg Roach        $this->assertInstanceOf(CensusColumnBirthDaySlashMonthYear::class, $columns[4]);
6271378461SGreg Roach        $this->assertInstanceOf(CensusColumnBirthPlace::class, $columns[5]);
6371378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[6]);
6471378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[7]);
6571378461SGreg Roach        $this->assertInstanceOf(CensusColumnReligion::class, $columns[8]);
6671378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[9]);
6771378461SGreg Roach        $this->assertInstanceOf(CensusColumnOccupation::class, $columns[10]);
6871378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[11]);
6971378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[12]);
7071378461SGreg Roach        $this->assertInstanceOf(CensusColumnNull::class, $columns[13]);
71c2a8c8bfSGreg Roach
72c2a8c8bfSGreg Roach        $this->assertSame('Jméno', $columns[0]->abbreviation());
73c2a8c8bfSGreg Roach        $this->assertSame('Vztah', $columns[1]->abbreviation());
74c2a8c8bfSGreg Roach        $this->assertSame('Pohlaví', $columns[2]->abbreviation());
75c2a8c8bfSGreg Roach        $this->assertSame('Stav', $columns[3]->abbreviation());
76c2a8c8bfSGreg Roach        $this->assertSame('Narození', $columns[4]->abbreviation());
77c2a8c8bfSGreg Roach        $this->assertSame('Místo', $columns[5]->abbreviation());
78c2a8c8bfSGreg Roach        $this->assertSame('Přísluší', $columns[6]->abbreviation());
79fbf0a249SGreg Roach        $this->assertSame('Národnost', $columns[7]->abbreviation());
80c2a8c8bfSGreg Roach        $this->assertSame('Vyznání', $columns[8]->abbreviation());
81fbf0a249SGreg Roach        $this->assertSame('Gramotnost', $columns[9]->abbreviation());
82fbf0a249SGreg Roach        $this->assertSame('Povolání', $columns[10]->abbreviation());
83fbf0a249SGreg Roach        $this->assertSame('Postavení', $columns[11]->abbreviation());
84fbf0a249SGreg Roach        $this->assertSame('Podnik', $columns[12]->abbreviation());
85c2a8c8bfSGreg Roach        $this->assertSame('', $columns[13]->abbreviation());
86c2a8c8bfSGreg Roach
87c2a8c8bfSGreg Roach        $this->assertSame('', $columns[0]->title());
88c2a8c8bfSGreg Roach        $this->assertSame('', $columns[1]->title());
89c2a8c8bfSGreg Roach        $this->assertSame('', $columns[2]->title());
90c2a8c8bfSGreg Roach        $this->assertSame('Rodinný stav', $columns[3]->title());
91c2a8c8bfSGreg Roach        $this->assertSame('Datum narození', $columns[4]->title());
92c2a8c8bfSGreg Roach        $this->assertSame('Místo narození', $columns[5]->title());
93c2a8c8bfSGreg Roach        $this->assertSame('Domovské právo', $columns[6]->title());
94fbf0a249SGreg Roach        $this->assertSame('Mateřský jazyk', $columns[7]->title());
95c2a8c8bfSGreg Roach        $this->assertSame('', $columns[8]->title());
96fbf0a249SGreg Roach        $this->assertSame('Znalost čtení a psaní', $columns[9]->title());
97fbf0a249SGreg Roach        $this->assertSame('', $columns[10]->title());
98fbf0a249SGreg Roach        $this->assertSame('Postavení v zaměstnání', $columns[11]->title());
99c2a8c8bfSGreg Roach        $this->assertSame('', $columns[12]->title());
100c2a8c8bfSGreg Roach        $this->assertSame('', $columns[13]->title());
101c2a8c8bfSGreg Roach    }
102c2a8c8bfSGreg Roach}
103