1c2a8c8bfSGreg Roach<?php 23976b470SGreg Roach 3c2a8c8bfSGreg Roach/** 4c2a8c8bfSGreg Roach * webtrees: online genealogy 58fcd0d32SGreg Roach * Copyright (C) 2019 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 */ 17*fcfa147eSGreg Roach 18e7f56f2aSGreg Roachdeclare(strict_types=1); 19e7f56f2aSGreg Roach 20c2a8c8bfSGreg Roachnamespace Fisharebest\Webtrees\Census; 21c2a8c8bfSGreg Roach 223cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase; 233cfcc809SGreg Roach 24c2a8c8bfSGreg Roach/** 25c2a8c8bfSGreg Roach * Test harness for the class CensusOfCzechRepublic1921 26c2a8c8bfSGreg Roach */ 273cfcc809SGreg Roachclass CensusOfCzechRepublic1921Test extends TestCase 28c1010edaSGreg Roach{ 29c2a8c8bfSGreg Roach /** 30c2a8c8bfSGreg Roach * Test the census place and date 31c2a8c8bfSGreg Roach * 3215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921 3352348eb8SGreg Roach * 3452348eb8SGreg Roach * @return void 35c2a8c8bfSGreg Roach */ 369b802b22SGreg Roach public function testPlaceAndDate(): void 37c1010edaSGreg Roach { 3874d6dc0eSGreg Roach $census = new CensusOfCzechRepublic1921(); 39c2a8c8bfSGreg Roach 40c2a8c8bfSGreg Roach $this->assertSame('Česko', $census->censusPlace()); 41c2a8c8bfSGreg Roach $this->assertSame('15 FEB 1921', $census->censusDate()); 42c2a8c8bfSGreg Roach } 43c2a8c8bfSGreg Roach 44c2a8c8bfSGreg Roach /** 45c2a8c8bfSGreg Roach * Test the census columns 46c2a8c8bfSGreg Roach * 4715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1921 4815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 4952348eb8SGreg Roach * 5052348eb8SGreg Roach * @return void 51c2a8c8bfSGreg Roach */ 529b802b22SGreg Roach public function testColumns(): void 53c1010edaSGreg Roach { 5474d6dc0eSGreg Roach $census = new CensusOfCzechRepublic1921(); 55c2a8c8bfSGreg Roach $columns = $census->columns(); 56c2a8c8bfSGreg Roach 57c2a8c8bfSGreg Roach $this->assertCount(14, $columns); 5871378461SGreg Roach $this->assertInstanceOf(CensusColumnFullName::class, $columns[0]); 5971378461SGreg Roach $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[1]); 6071378461SGreg Roach $this->assertInstanceOf(CensusColumnSexMZ::class, $columns[2]); 6171378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[3]); 6271378461SGreg Roach $this->assertInstanceOf(CensusColumnBirthDaySlashMonthYear::class, $columns[4]); 6371378461SGreg Roach $this->assertInstanceOf(CensusColumnBirthPlace::class, $columns[5]); 6471378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[6]); 6571378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[7]); 6671378461SGreg Roach $this->assertInstanceOf(CensusColumnReligion::class, $columns[8]); 6771378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[9]); 6871378461SGreg Roach $this->assertInstanceOf(CensusColumnOccupation::class, $columns[10]); 6971378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[11]); 7071378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[12]); 7171378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[13]); 72c2a8c8bfSGreg Roach 73c2a8c8bfSGreg Roach $this->assertSame('Jméno', $columns[0]->abbreviation()); 74c2a8c8bfSGreg Roach $this->assertSame('Vztah', $columns[1]->abbreviation()); 75c2a8c8bfSGreg Roach $this->assertSame('Pohlaví', $columns[2]->abbreviation()); 76c2a8c8bfSGreg Roach $this->assertSame('Stav', $columns[3]->abbreviation()); 77c2a8c8bfSGreg Roach $this->assertSame('Narození', $columns[4]->abbreviation()); 78c2a8c8bfSGreg Roach $this->assertSame('Místo', $columns[5]->abbreviation()); 79c2a8c8bfSGreg Roach $this->assertSame('Přísluší', $columns[6]->abbreviation()); 80fbf0a249SGreg Roach $this->assertSame('Národnost', $columns[7]->abbreviation()); 81c2a8c8bfSGreg Roach $this->assertSame('Vyznání', $columns[8]->abbreviation()); 82fbf0a249SGreg Roach $this->assertSame('Gramotnost', $columns[9]->abbreviation()); 83fbf0a249SGreg Roach $this->assertSame('Povolání', $columns[10]->abbreviation()); 84fbf0a249SGreg Roach $this->assertSame('Postavení', $columns[11]->abbreviation()); 85fbf0a249SGreg Roach $this->assertSame('Podnik', $columns[12]->abbreviation()); 86c2a8c8bfSGreg Roach $this->assertSame('', $columns[13]->abbreviation()); 87c2a8c8bfSGreg Roach 88c2a8c8bfSGreg Roach $this->assertSame('', $columns[0]->title()); 89c2a8c8bfSGreg Roach $this->assertSame('', $columns[1]->title()); 90c2a8c8bfSGreg Roach $this->assertSame('', $columns[2]->title()); 91c2a8c8bfSGreg Roach $this->assertSame('Rodinný stav', $columns[3]->title()); 92c2a8c8bfSGreg Roach $this->assertSame('Datum narození', $columns[4]->title()); 93c2a8c8bfSGreg Roach $this->assertSame('Místo narození', $columns[5]->title()); 94c2a8c8bfSGreg Roach $this->assertSame('Domovské právo', $columns[6]->title()); 95fbf0a249SGreg Roach $this->assertSame('Mateřský jazyk', $columns[7]->title()); 96c2a8c8bfSGreg Roach $this->assertSame('', $columns[8]->title()); 97fbf0a249SGreg Roach $this->assertSame('Znalost čtení a psaní', $columns[9]->title()); 98fbf0a249SGreg Roach $this->assertSame('', $columns[10]->title()); 99fbf0a249SGreg Roach $this->assertSame('Postavení v zaměstnání', $columns[11]->title()); 100c2a8c8bfSGreg Roach $this->assertSame('', $columns[12]->title()); 101c2a8c8bfSGreg Roach $this->assertSame('', $columns[13]->title()); 102c2a8c8bfSGreg Roach } 103c2a8c8bfSGreg Roach} 104