xref: /webtrees/tests/app/Census/CensusOfCzechRepublic1921Test.php (revision e7f56f2af615447ab1a7646851f88b465ace9e04)
1c2a8c8bfSGreg Roach<?php
2c2a8c8bfSGreg Roach/**
3c2a8c8bfSGreg Roach * webtrees: online genealogy
41062a142SGreg Roach * Copyright (C) 2018 webtrees development team
5c2a8c8bfSGreg Roach * This program is free software: you can redistribute it and/or modify
6c2a8c8bfSGreg Roach * it under the terms of the GNU General Public License as published by
7c2a8c8bfSGreg Roach * the Free Software Foundation, either version 3 of the License, or
8c2a8c8bfSGreg Roach * (at your option) any later version.
9c2a8c8bfSGreg Roach * This program is distributed in the hope that it will be useful,
10c2a8c8bfSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
11c2a8c8bfSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12c2a8c8bfSGreg Roach * GNU General Public License for more details.
13c2a8c8bfSGreg Roach * You should have received a copy of the GNU General Public License
14c2a8c8bfSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
15c2a8c8bfSGreg Roach */
16*e7f56f2aSGreg Roachdeclare(strict_types=1);
17*e7f56f2aSGreg Roach
18c2a8c8bfSGreg Roachnamespace Fisharebest\Webtrees\Census;
19c2a8c8bfSGreg Roach
20c2a8c8bfSGreg Roach/**
21c2a8c8bfSGreg Roach * Test harness for the class CensusOfCzechRepublic1921
22c2a8c8bfSGreg Roach */
2384e2cf4eSGreg Roachclass CensusOfCzechRepublic1921Test extends \Fisharebest\Webtrees\TestCase
24c1010edaSGreg Roach{
25c2a8c8bfSGreg Roach    /**
26c2a8c8bfSGreg Roach     * Test the census place and date
27c2a8c8bfSGreg Roach     *
2815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921
2952348eb8SGreg Roach     *
3052348eb8SGreg Roach     * @return void
31c2a8c8bfSGreg Roach     */
32c1010edaSGreg Roach    public function testPlaceAndDate()
33c1010edaSGreg Roach    {
34c2a8c8bfSGreg Roach        $census = new CensusOfCzechRepublic1921;
35c2a8c8bfSGreg Roach
36c2a8c8bfSGreg Roach        $this->assertSame('Česko', $census->censusPlace());
37c2a8c8bfSGreg Roach        $this->assertSame('15 FEB 1921', $census->censusDate());
38c2a8c8bfSGreg Roach    }
39c2a8c8bfSGreg Roach
40c2a8c8bfSGreg Roach    /**
41c2a8c8bfSGreg Roach     * Test the census columns
42c2a8c8bfSGreg Roach     *
4315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921
4415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
4552348eb8SGreg Roach     *
4652348eb8SGreg Roach     * @return void
47c2a8c8bfSGreg Roach     */
48c1010edaSGreg Roach    public function testColumns()
49c1010edaSGreg Roach    {
50c2a8c8bfSGreg Roach        $census  = new CensusOfCzechRepublic1921;
51c2a8c8bfSGreg Roach        $columns = $census->columns();
52c2a8c8bfSGreg Roach
53c2a8c8bfSGreg Roach        $this->assertCount(14, $columns);
54c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnFullName', $columns[0]);
55c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[1]);
56c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSexMZ', $columns[2]);
57c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[3]);
58c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthDaySlashMonthYear', $columns[4]);
59c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[5]);
60c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[6]);
61c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]);
62c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnReligion', $columns[8]);
63fbf0a249SGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[9]);
64fbf0a249SGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[10]);
65c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[11]);
66c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[12]);
67c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[13]);
68c2a8c8bfSGreg Roach
69c2a8c8bfSGreg Roach        $this->assertSame('Jméno', $columns[0]->abbreviation());
70c2a8c8bfSGreg Roach        $this->assertSame('Vztah', $columns[1]->abbreviation());
71c2a8c8bfSGreg Roach        $this->assertSame('Pohlaví', $columns[2]->abbreviation());
72c2a8c8bfSGreg Roach        $this->assertSame('Stav', $columns[3]->abbreviation());
73c2a8c8bfSGreg Roach        $this->assertSame('Narození', $columns[4]->abbreviation());
74c2a8c8bfSGreg Roach        $this->assertSame('Místo', $columns[5]->abbreviation());
75c2a8c8bfSGreg Roach        $this->assertSame('Přísluší', $columns[6]->abbreviation());
76fbf0a249SGreg Roach        $this->assertSame('Národnost', $columns[7]->abbreviation());
77c2a8c8bfSGreg Roach        $this->assertSame('Vyznání', $columns[8]->abbreviation());
78fbf0a249SGreg Roach        $this->assertSame('Gramotnost', $columns[9]->abbreviation());
79fbf0a249SGreg Roach        $this->assertSame('Povolání', $columns[10]->abbreviation());
80fbf0a249SGreg Roach        $this->assertSame('Postavení', $columns[11]->abbreviation());
81fbf0a249SGreg Roach        $this->assertSame('Podnik', $columns[12]->abbreviation());
82c2a8c8bfSGreg Roach        $this->assertSame('', $columns[13]->abbreviation());
83c2a8c8bfSGreg Roach
84c2a8c8bfSGreg Roach        $this->assertSame('', $columns[0]->title());
85c2a8c8bfSGreg Roach        $this->assertSame('', $columns[1]->title());
86c2a8c8bfSGreg Roach        $this->assertSame('', $columns[2]->title());
87c2a8c8bfSGreg Roach        $this->assertSame('Rodinný stav', $columns[3]->title());
88c2a8c8bfSGreg Roach        $this->assertSame('Datum narození', $columns[4]->title());
89c2a8c8bfSGreg Roach        $this->assertSame('Místo narození', $columns[5]->title());
90c2a8c8bfSGreg Roach        $this->assertSame('Domovské právo', $columns[6]->title());
91fbf0a249SGreg Roach        $this->assertSame('Mateřský jazyk', $columns[7]->title());
92c2a8c8bfSGreg Roach        $this->assertSame('', $columns[8]->title());
93fbf0a249SGreg Roach        $this->assertSame('Znalost čtení a psaní', $columns[9]->title());
94fbf0a249SGreg Roach        $this->assertSame('', $columns[10]->title());
95fbf0a249SGreg Roach        $this->assertSame('Postavení v zaměstnání', $columns[11]->title());
96c2a8c8bfSGreg Roach        $this->assertSame('', $columns[12]->title());
97c2a8c8bfSGreg Roach        $this->assertSame('', $columns[13]->title());
98c2a8c8bfSGreg Roach    }
99c2a8c8bfSGreg Roach}
100