xref: /webtrees/tests/app/Census/CensusOfCzechRepublic1880Test.php (revision c1010eda29c0909ed4d5d463f32d32bfefdd4dfe)
1c2a8c8bfSGreg Roach<?php
2c2a8c8bfSGreg Roach
3c2a8c8bfSGreg Roach/**
4c2a8c8bfSGreg Roach * webtrees: online genealogy
51062a142SGreg Roach * Copyright (C) 2018 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 */
17c2a8c8bfSGreg Roachnamespace Fisharebest\Webtrees\Census;
18c2a8c8bfSGreg Roach
19c2a8c8bfSGreg Roach/**
20c2a8c8bfSGreg Roach * Test harness for the class CensusOfCzechRepublic1880
21c2a8c8bfSGreg Roach */
22*c1010edaSGreg Roachclass CensusOfCzechRepublic1880Test extends \PHPUnit\Framework\TestCase
23*c1010edaSGreg Roach{
24c2a8c8bfSGreg Roach    /**
25c2a8c8bfSGreg Roach     * Test the census place and date
26c2a8c8bfSGreg Roach     *
2715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1880
28c2a8c8bfSGreg Roach     */
29*c1010edaSGreg Roach    public function testPlaceAndDate()
30*c1010edaSGreg Roach    {
31c2a8c8bfSGreg Roach        $census = new CensusOfCzechRepublic1880;
32c2a8c8bfSGreg Roach
33c2a8c8bfSGreg Roach        $this->assertSame('Česko', $census->censusPlace());
34c2a8c8bfSGreg Roach        $this->assertSame('31 DEC 1880', $census->censusDate());
35c2a8c8bfSGreg Roach    }
36c2a8c8bfSGreg Roach
37c2a8c8bfSGreg Roach    /**
38c2a8c8bfSGreg Roach     * Test the census columns
39c2a8c8bfSGreg Roach     *
4015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1880
4115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
42c2a8c8bfSGreg Roach     */
43*c1010edaSGreg Roach    public function testColumns()
44*c1010edaSGreg Roach    {
45c2a8c8bfSGreg Roach        $census  = new CensusOfCzechRepublic1880;
46c2a8c8bfSGreg Roach        $columns = $census->columns();
47c2a8c8bfSGreg Roach
48fbf0a249SGreg Roach        $this->assertCount(13, $columns);
49c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnFullName', $columns[0]);
50fbf0a249SGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[1]);
51fbf0a249SGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSexMZ', $columns[2]);
52c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthDaySlashMonthYear', $columns[3]);
53c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[4]);
54c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[5]);
55c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnReligion', $columns[6]);
56c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]);
57c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[8]);
58c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[9]);
59c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[10]);
60c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[11]);
61c2a8c8bfSGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[12]);
62c2a8c8bfSGreg Roach
63c2a8c8bfSGreg Roach        $this->assertSame('Jméno', $columns[0]->abbreviation());
64fbf0a249SGreg Roach        $this->assertSame('Vztah', $columns[1]->abbreviation());
65fbf0a249SGreg Roach        $this->assertSame('Pohlaví', $columns[2]->abbreviation());
66c2a8c8bfSGreg Roach        $this->assertSame('Narození', $columns[3]->abbreviation());
67fbf0a249SGreg Roach        $this->assertSame('Rodiště', $columns[4]->abbreviation());
68c2a8c8bfSGreg Roach        $this->assertSame('Přísluší', $columns[5]->abbreviation());
69c2a8c8bfSGreg Roach        $this->assertSame('Vyznání', $columns[6]->abbreviation());
70c2a8c8bfSGreg Roach        $this->assertSame('Stav', $columns[7]->abbreviation());
71c2a8c8bfSGreg Roach        $this->assertSame('Jazyk', $columns[8]->abbreviation());
72c2a8c8bfSGreg Roach        $this->assertSame('Povolání', $columns[9]->abbreviation());
73c2a8c8bfSGreg Roach        $this->assertSame('Postavení', $columns[10]->abbreviation());
74fbf0a249SGreg Roach        $this->assertSame('Gramotnost', $columns[11]->abbreviation());
75fbf0a249SGreg Roach        $this->assertSame('Druh pobytu', $columns[12]->abbreviation());
76c2a8c8bfSGreg Roach
77c2a8c8bfSGreg Roach        $this->assertSame('', $columns[0]->title());
78c2a8c8bfSGreg Roach        $this->assertSame('', $columns[1]->title());
79c2a8c8bfSGreg Roach        $this->assertSame('', $columns[2]->title());
80c2a8c8bfSGreg Roach        $this->assertSame('Datum narození', $columns[3]->title());
81c2a8c8bfSGreg Roach        $this->assertSame('Místo narození', $columns[4]->title());
82c2a8c8bfSGreg Roach        $this->assertSame('Domovské právo', $columns[5]->title());
83c2a8c8bfSGreg Roach        $this->assertSame('', $columns[6]->title());
84c2a8c8bfSGreg Roach        $this->assertSame('Rodinný stav', $columns[7]->title());
85c2a8c8bfSGreg Roach        $this->assertSame('Jazyk v obcování', $columns[8]->title());
86c2a8c8bfSGreg Roach        $this->assertSame('', $columns[9]->title());
87c2a8c8bfSGreg Roach        $this->assertSame('Postavení v zaměstnání', $columns[10]->title());
88fbf0a249SGreg Roach        $this->assertSame('Znalost čtení a psaní', $columns[11]->title());
89fbf0a249SGreg Roach        $this->assertSame('Pobyt dočasný nebo trvalý', $columns[12]->title());
90c2a8c8bfSGreg Roach    }
91c2a8c8bfSGreg Roach}
92