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 */ 16c2a8c8bfSGreg Roachnamespace Fisharebest\Webtrees\Census; 17c2a8c8bfSGreg Roach 18c2a8c8bfSGreg Roach/** 19c2a8c8bfSGreg Roach * Test harness for the class CensusOfCzechRepublic1921 20c2a8c8bfSGreg Roach */ 21*84e2cf4eSGreg Roachclass CensusOfCzechRepublic1921Test extends \Fisharebest\Webtrees\TestCase 22c1010edaSGreg Roach{ 23c2a8c8bfSGreg Roach /** 24c2a8c8bfSGreg Roach * Test the census place and date 25c2a8c8bfSGreg Roach * 2615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921 27c2a8c8bfSGreg Roach */ 28c1010edaSGreg Roach public function testPlaceAndDate() 29c1010edaSGreg Roach { 30c2a8c8bfSGreg Roach $census = new CensusOfCzechRepublic1921; 31c2a8c8bfSGreg Roach 32c2a8c8bfSGreg Roach $this->assertSame('Česko', $census->censusPlace()); 33c2a8c8bfSGreg Roach $this->assertSame('15 FEB 1921', $census->censusDate()); 34c2a8c8bfSGreg Roach } 35c2a8c8bfSGreg Roach 36c2a8c8bfSGreg Roach /** 37c2a8c8bfSGreg Roach * Test the census columns 38c2a8c8bfSGreg Roach * 3915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921 4015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 41c2a8c8bfSGreg Roach */ 42c1010edaSGreg Roach public function testColumns() 43c1010edaSGreg Roach { 44c2a8c8bfSGreg Roach $census = new CensusOfCzechRepublic1921; 45c2a8c8bfSGreg Roach $columns = $census->columns(); 46c2a8c8bfSGreg Roach 47c2a8c8bfSGreg Roach $this->assertCount(14, $columns); 48c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnFullName', $columns[0]); 49c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[1]); 50c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSexMZ', $columns[2]); 51c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[3]); 52c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthDaySlashMonthYear', $columns[4]); 53c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[5]); 54c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[6]); 55c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]); 56c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnReligion', $columns[8]); 57fbf0a249SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[9]); 58fbf0a249SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[10]); 59c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[11]); 60c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[12]); 61c2a8c8bfSGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[13]); 62c2a8c8bfSGreg Roach 63c2a8c8bfSGreg Roach $this->assertSame('Jméno', $columns[0]->abbreviation()); 64c2a8c8bfSGreg Roach $this->assertSame('Vztah', $columns[1]->abbreviation()); 65c2a8c8bfSGreg Roach $this->assertSame('Pohlaví', $columns[2]->abbreviation()); 66c2a8c8bfSGreg Roach $this->assertSame('Stav', $columns[3]->abbreviation()); 67c2a8c8bfSGreg Roach $this->assertSame('Narození', $columns[4]->abbreviation()); 68c2a8c8bfSGreg Roach $this->assertSame('Místo', $columns[5]->abbreviation()); 69c2a8c8bfSGreg Roach $this->assertSame('Přísluší', $columns[6]->abbreviation()); 70fbf0a249SGreg Roach $this->assertSame('Národnost', $columns[7]->abbreviation()); 71c2a8c8bfSGreg Roach $this->assertSame('Vyznání', $columns[8]->abbreviation()); 72fbf0a249SGreg Roach $this->assertSame('Gramotnost', $columns[9]->abbreviation()); 73fbf0a249SGreg Roach $this->assertSame('Povolání', $columns[10]->abbreviation()); 74fbf0a249SGreg Roach $this->assertSame('Postavení', $columns[11]->abbreviation()); 75fbf0a249SGreg Roach $this->assertSame('Podnik', $columns[12]->abbreviation()); 76c2a8c8bfSGreg Roach $this->assertSame('', $columns[13]->abbreviation()); 77c2a8c8bfSGreg Roach 78c2a8c8bfSGreg Roach $this->assertSame('', $columns[0]->title()); 79c2a8c8bfSGreg Roach $this->assertSame('', $columns[1]->title()); 80c2a8c8bfSGreg Roach $this->assertSame('', $columns[2]->title()); 81c2a8c8bfSGreg Roach $this->assertSame('Rodinný stav', $columns[3]->title()); 82c2a8c8bfSGreg Roach $this->assertSame('Datum narození', $columns[4]->title()); 83c2a8c8bfSGreg Roach $this->assertSame('Místo narození', $columns[5]->title()); 84c2a8c8bfSGreg Roach $this->assertSame('Domovské právo', $columns[6]->title()); 85fbf0a249SGreg Roach $this->assertSame('Mateřský jazyk', $columns[7]->title()); 86c2a8c8bfSGreg Roach $this->assertSame('', $columns[8]->title()); 87fbf0a249SGreg Roach $this->assertSame('Znalost čtení a psaní', $columns[9]->title()); 88fbf0a249SGreg Roach $this->assertSame('', $columns[10]->title()); 89fbf0a249SGreg Roach $this->assertSame('Postavení v zaměstnání', $columns[11]->title()); 90c2a8c8bfSGreg Roach $this->assertSame('', $columns[12]->title()); 91c2a8c8bfSGreg Roach $this->assertSame('', $columns[13]->title()); 92c2a8c8bfSGreg Roach } 93c2a8c8bfSGreg Roach} 94