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