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