1fbf0a249SGreg Roach<?php 23976b470SGreg Roach 3fbf0a249SGreg Roach/** 4fbf0a249SGreg Roach * webtrees: online genealogy 58fcd0d32SGreg Roach * Copyright (C) 2019 webtrees development team 6fbf0a249SGreg Roach * This program is free software: you can redistribute it and/or modify 7fbf0a249SGreg Roach * it under the terms of the GNU General Public License as published by 8fbf0a249SGreg Roach * the Free Software Foundation, either version 3 of the License, or 9fbf0a249SGreg Roach * (at your option) any later version. 10fbf0a249SGreg Roach * This program is distributed in the hope that it will be useful, 11fbf0a249SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 12fbf0a249SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13fbf0a249SGreg Roach * GNU General Public License for more details. 14fbf0a249SGreg Roach * You should have received a copy of the GNU General Public License 15fbf0a249SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 16fbf0a249SGreg Roach */ 17e7f56f2aSGreg Roachdeclare(strict_types=1); 18e7f56f2aSGreg Roach 19fbf0a249SGreg Roachnamespace Fisharebest\Webtrees\Census; 20fbf0a249SGreg Roach 21*3cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase; 22*3cfcc809SGreg Roach 23fbf0a249SGreg Roach/** 24fbf0a249SGreg Roach * Test harness for the class CensusOfCzechRepublic1890 25fbf0a249SGreg Roach */ 26*3cfcc809SGreg Roachclass CensusOfCzechRepublic1890Test extends TestCase 27c1010edaSGreg Roach{ 28fbf0a249SGreg Roach /** 29fbf0a249SGreg Roach * Test the census place and date 30fbf0a249SGreg Roach * 31fbf0a249SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1890 3252348eb8SGreg Roach * 3352348eb8SGreg Roach * @return void 34fbf0a249SGreg Roach */ 359b802b22SGreg Roach public function testPlaceAndDate(): void 36c1010edaSGreg Roach { 3774d6dc0eSGreg Roach $census = new CensusOfCzechRepublic1890(); 38fbf0a249SGreg Roach 39fbf0a249SGreg Roach $this->assertSame('Česko', $census->censusPlace()); 40fbf0a249SGreg Roach $this->assertSame('31 DEC 1890', $census->censusDate()); 41fbf0a249SGreg Roach } 42fbf0a249SGreg Roach 43fbf0a249SGreg Roach /** 44fbf0a249SGreg Roach * Test the census columns 45fbf0a249SGreg Roach * 46fbf0a249SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusOfCzechRepublic1890 47fbf0a249SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 4852348eb8SGreg Roach * 4952348eb8SGreg Roach * @return void 50fbf0a249SGreg Roach */ 519b802b22SGreg Roach public function testColumns(): void 52c1010edaSGreg Roach { 5374d6dc0eSGreg Roach $census = new CensusOfCzechRepublic1890(); 54fbf0a249SGreg Roach $columns = $census->columns(); 55fbf0a249SGreg Roach 56fbf0a249SGreg Roach $this->assertCount(13, $columns); 5771378461SGreg Roach $this->assertInstanceOf(CensusColumnFullName::class, $columns[0]); 5871378461SGreg Roach $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[1]); 5971378461SGreg Roach $this->assertInstanceOf(CensusColumnSexMZ::class, $columns[2]); 6071378461SGreg Roach $this->assertInstanceOf(CensusColumnBirthDaySlashMonthYear::class, $columns[3]); 6171378461SGreg Roach $this->assertInstanceOf(CensusColumnBirthPlace::class, $columns[4]); 6271378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[5]); 6371378461SGreg Roach $this->assertInstanceOf(CensusColumnReligion::class, $columns[6]); 6471378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[7]); 6571378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[8]); 6671378461SGreg Roach $this->assertInstanceOf(CensusColumnOccupation::class, $columns[9]); 6771378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[10]); 6871378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[11]); 6971378461SGreg Roach $this->assertInstanceOf(CensusColumnNull::class, $columns[12]); 70fbf0a249SGreg Roach 71fbf0a249SGreg Roach $this->assertSame('Jméno', $columns[0]->abbreviation()); 72fbf0a249SGreg Roach $this->assertSame('Vztah', $columns[1]->abbreviation()); 73fbf0a249SGreg Roach $this->assertSame('Pohlaví', $columns[2]->abbreviation()); 74fbf0a249SGreg Roach $this->assertSame('Narození', $columns[3]->abbreviation()); 75fbf0a249SGreg Roach $this->assertSame('Rodiště', $columns[4]->abbreviation()); 76fbf0a249SGreg Roach $this->assertSame('Přísluší', $columns[5]->abbreviation()); 77fbf0a249SGreg Roach $this->assertSame('Vyznání', $columns[6]->abbreviation()); 78fbf0a249SGreg Roach $this->assertSame('Stav', $columns[7]->abbreviation()); 79fbf0a249SGreg Roach $this->assertSame('Jazyk', $columns[8]->abbreviation()); 80fbf0a249SGreg Roach $this->assertSame('Povolání', $columns[9]->abbreviation()); 81fbf0a249SGreg Roach $this->assertSame('Postavení', $columns[10]->abbreviation()); 82fbf0a249SGreg Roach $this->assertSame('Gramotnost', $columns[11]->abbreviation()); 83fbf0a249SGreg Roach $this->assertSame('Druh pobytu', $columns[12]->abbreviation()); 84fbf0a249SGreg Roach 85fbf0a249SGreg Roach $this->assertSame('', $columns[0]->title()); 86fbf0a249SGreg Roach $this->assertSame('', $columns[1]->title()); 87fbf0a249SGreg Roach $this->assertSame('', $columns[2]->title()); 88fbf0a249SGreg Roach $this->assertSame('Datum narození', $columns[3]->title()); 89fbf0a249SGreg Roach $this->assertSame('Místo narození', $columns[4]->title()); 90fbf0a249SGreg Roach $this->assertSame('Domovské právo', $columns[5]->title()); 91fbf0a249SGreg Roach $this->assertSame('', $columns[6]->title()); 92fbf0a249SGreg Roach $this->assertSame('Rodinný stav', $columns[7]->title()); 93fbf0a249SGreg Roach $this->assertSame('Jazyk v obcování', $columns[8]->title()); 94fbf0a249SGreg Roach $this->assertSame('', $columns[9]->title()); 95fbf0a249SGreg Roach $this->assertSame('Postavení v zaměstnání', $columns[10]->title()); 96fbf0a249SGreg Roach $this->assertSame('Znalost čtení a psaní', $columns[11]->title()); 97fbf0a249SGreg Roach $this->assertSame('Pobyt dočasný nebo trvalý', $columns[12]->title()); 98fbf0a249SGreg Roach } 99fbf0a249SGreg Roach} 100