1c2a8c8bfSGreg Roach<?php 23976b470SGreg Roach 3c2a8c8bfSGreg Roach/** 4c2a8c8bfSGreg Roach * webtrees: online genealogy 589f7189bSGreg Roach * Copyright (C) 2021 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 1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>. 16c2a8c8bfSGreg Roach */ 17fcfa147eSGreg 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 405e933c21SGreg Roach self::assertSame('Česko', $census->censusPlace()); 415e933c21SGreg Roach self::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 57*720ec754SGreg Roach self::assertCount(20, $columns); 58*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[0]); 59*720ec754SGreg Roach self::assertInstanceOf(CensusColumnSurname::class, $columns[1]); 60*720ec754SGreg Roach self::assertInstanceOf(CensusColumnGivenNames::class, $columns[2]); 61*720ec754SGreg Roach self::assertInstanceOf(CensusColumnRelationToHead::class, $columns[3]); 62*720ec754SGreg Roach self::assertInstanceOf(CensusColumnSexMZ::class, $columns[4]); 63*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[5]); 64*720ec754SGreg Roach self::assertInstanceOf(CensusColumnBirthDayDotMonthYear::class, $columns[6]); 65*720ec754SGreg Roach self::assertInstanceOf(CensusColumnBirthPlace::class, $columns[7]); 66*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[8]); 675e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[9]); 68*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[10]); 69*720ec754SGreg Roach self::assertInstanceOf(CensusColumnReligion::class, $columns[11]); 705e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[12]); 71*720ec754SGreg Roach self::assertInstanceOf(CensusColumnOccupation::class, $columns[13]); 72*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[14]); 73*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[15]); 74*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[16]); 75*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[17]); 76*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[18]); 77*720ec754SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[19]); 78c2a8c8bfSGreg Roach 79*720ec754SGreg Roach self::assertSame('Ř.č.', $columns[0]->abbreviation()); 80*720ec754SGreg Roach self::assertSame('Příjmení', $columns[1]->abbreviation()); 81*720ec754SGreg Roach self::assertSame('Jméno', $columns[2]->abbreviation()); 82*720ec754SGreg Roach self::assertSame('Vztah', $columns[3]->abbreviation()); 83*720ec754SGreg Roach self::assertSame('Pohlaví', $columns[4]->abbreviation()); 84*720ec754SGreg Roach self::assertSame('Stav', $columns[5]->abbreviation()); 85*720ec754SGreg Roach self::assertSame('Narození', $columns[6]->abbreviation()); 86*720ec754SGreg Roach self::assertSame('Rodiště', $columns[7]->abbreviation()); 87*720ec754SGreg Roach self::assertSame('Bydlí od', $columns[8]->abbreviation()); 88*720ec754SGreg Roach self::assertSame('Přísluší', $columns[9]->abbreviation()); 89*720ec754SGreg Roach self::assertSame('Národnost', $columns[10]->abbreviation()); 90*720ec754SGreg Roach self::assertSame('Vyznání', $columns[11]->abbreviation()); 91*720ec754SGreg Roach self::assertSame('Gramotnost', $columns[12]->abbreviation()); 92*720ec754SGreg Roach self::assertSame('Povolání', $columns[13]->abbreviation()); 93*720ec754SGreg Roach self::assertSame('Postavení', $columns[14]->abbreviation()); 94*720ec754SGreg Roach self::assertSame('Podnik', $columns[15]->abbreviation()); 95*720ec754SGreg Roach self::assertSame('Měl povolání 1914', $columns[16]->abbreviation()); 96*720ec754SGreg Roach self::assertSame('Povolání 1914', $columns[17]->abbreviation()); 97*720ec754SGreg Roach self::assertSame('Postavení 1914', $columns[18]->abbreviation()); 98*720ec754SGreg Roach self::assertSame('Poznámka', $columns[19]->abbreviation()); 99c2a8c8bfSGreg Roach 100*720ec754SGreg Roach self::assertSame('Řadové číslo', $columns[0]->title()); 101*720ec754SGreg Roach self::assertSame('jméno rodinné', $columns[1]->title()); 102*720ec754SGreg Roach self::assertSame('Jméno (křestni)', $columns[2]->title()); 103*720ec754SGreg Roach self::assertSame('', $columns[3]->title()); 104*720ec754SGreg Roach self::assertSame('', $columns[4]->title()); 105*720ec754SGreg Roach self::assertSame('Rodinný stav', $columns[5]->title()); 106*720ec754SGreg Roach self::assertSame('Datum narození', $columns[6]->title()); 107*720ec754SGreg Roach self::assertSame('Rodná obec, Soudní okres, Země', $columns[7]->title()); 108*720ec754SGreg Roach self::assertSame('Od kdy bydlí zapsána osoba v obci?', $columns[8]->title()); 109*720ec754SGreg Roach self::assertSame('Domovské právo', $columns[9]->title()); 110*720ec754SGreg Roach self::assertSame('Mateřský jazyk', $columns[10]->title()); 111*720ec754SGreg Roach self::assertSame('', $columns[11]->title()); 112*720ec754SGreg Roach self::assertSame('Znalost čtení a psaní', $columns[12]->title()); 113*720ec754SGreg Roach self::assertSame('Druh povolání', $columns[13]->title()); 114*720ec754SGreg Roach self::assertSame('Postavení v zaměstnání', $columns[14]->title()); 115*720ec754SGreg Roach self::assertSame('', $columns[15]->title()); 116*720ec754SGreg Roach self::assertSame('', $columns[16]->title()); 117*720ec754SGreg Roach self::assertSame('Druh povolání dne 16. července 1914', $columns[17]->title()); 118*720ec754SGreg Roach self::assertSame('Postavení v zaměstnání dne 16. července 1914', $columns[18]->title()); 119*720ec754SGreg Roach self::assertSame('', $columns[19]->title()); 120c2a8c8bfSGreg Roach } 121c2a8c8bfSGreg Roach} 122