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