1c18c4744SGreg Roach<?php 2c18c4744SGreg Roach 3c18c4744SGreg Roach/** 4c18c4744SGreg Roach * webtrees: online genealogy 5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team 6c18c4744SGreg Roach * This program is free software: you can redistribute it and/or modify 7c18c4744SGreg Roach * it under the terms of the GNU General Public License as published by 8c18c4744SGreg Roach * the Free Software Foundation, either version 3 of the License, or 9c18c4744SGreg Roach * (at your option) any later version. 10c18c4744SGreg Roach * This program is distributed in the hope that it will be useful, 11c18c4744SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 12c18c4744SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13c18c4744SGreg Roach * GNU General Public License for more details. 14c18c4744SGreg 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/>. 16c18c4744SGreg Roach */ 17c18c4744SGreg Roach 18c18c4744SGreg Roachdeclare(strict_types=1); 19c18c4744SGreg Roach 20c18c4744SGreg Roachnamespace Fisharebest\Webtrees\Census; 21c18c4744SGreg Roach 22c18c4744SGreg Roachuse Fisharebest\Webtrees\TestCase; 23*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass; 24c18c4744SGreg Roach 25*202c018bSGreg Roach#[CoversClass(CensusOfSlovakia1869::class)] 26*202c018bSGreg Roach#[CoversClass(AbstractCensusColumn::class)] 27c18c4744SGreg Roachclass CensusOfSlovakia1869Test extends TestCase 28c18c4744SGreg Roach{ 29c18c4744SGreg Roach /** 30c18c4744SGreg Roach * Test the census place and date 31c18c4744SGreg Roach */ 32c18c4744SGreg Roach public function testPlaceAndDate(): void 33c18c4744SGreg Roach { 34c18c4744SGreg Roach $census = new CensusOfSlovakia1869(); 35c18c4744SGreg Roach 365e933c21SGreg Roach self::assertSame('Slovensko', $census->censusPlace()); 375e933c21SGreg Roach self::assertSame('31 DEC 1869', $census->censusDate()); 38c18c4744SGreg Roach } 39c18c4744SGreg Roach 40c18c4744SGreg Roach /** 41c18c4744SGreg Roach * Test the census columns 42c18c4744SGreg Roach */ 43c18c4744SGreg Roach public function testColumns(): void 44c18c4744SGreg Roach { 45c18c4744SGreg Roach $census = new CensusOfSlovakia1869(); 46c18c4744SGreg Roach $columns = $census->columns(); 47c18c4744SGreg Roach 485e933c21SGreg Roach self::assertCount(20, $columns); 495e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[0]); 505e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[1]); 515e933c21SGreg Roach self::assertInstanceOf(CensusColumnFullName::class, $columns[2]); 525e933c21SGreg Roach self::assertInstanceOf(CensusColumnRelationToHead::class, $columns[3]); 535e933c21SGreg Roach self::assertInstanceOf(CensusColumnSexMZ::class, $columns[4]); 545e933c21SGreg Roach self::assertInstanceOf(CensusColumnBirthYear::class, $columns[5]); 555e933c21SGreg Roach self::assertInstanceOf(CensusColumnReligion::class, $columns[6]); 565e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[7]); 575e933c21SGreg Roach self::assertInstanceOf(CensusColumnOccupation::class, $columns[8]); 585e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[9]); 595e933c21SGreg Roach self::assertInstanceOf(CensusColumnBirthPlace::class, $columns[10]); 605e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[11]); 615e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[12]); 625e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[13]); 635e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[14]); 645e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[15]); 655e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[16]); 665e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[17]); 675e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[18]); 685e933c21SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[19]); 69c18c4744SGreg Roach 705e933c21SGreg Roach self::assertSame('Č. b.', $columns[0]->abbreviation()); 715e933c21SGreg Roach self::assertSame('Č. os.', $columns[1]->abbreviation()); 725e933c21SGreg Roach self::assertSame('Meno', $columns[2]->abbreviation()); 735e933c21SGreg Roach self::assertSame('Vzťah', $columns[3]->abbreviation()); 745e933c21SGreg Roach self::assertSame('Poh.', $columns[4]->abbreviation()); 755e933c21SGreg Roach self::assertSame('Nar.', $columns[5]->abbreviation()); 765e933c21SGreg Roach self::assertSame('Náb.', $columns[6]->abbreviation()); 775e933c21SGreg Roach self::assertSame('Stav', $columns[7]->abbreviation()); 785e933c21SGreg Roach self::assertSame('Povolanie', $columns[8]->abbreviation()); 795e933c21SGreg Roach self::assertSame('Zamestnanie', $columns[9]->abbreviation()); 805e933c21SGreg Roach self::assertSame('Rodisko', $columns[10]->abbreviation()); 815e933c21SGreg Roach self::assertSame('Dom.', $columns[11]->abbreviation()); 825e933c21SGreg Roach self::assertSame('Cudz.', $columns[12]->abbreviation()); 835e933c21SGreg Roach self::assertSame('P. doč.', $columns[13]->abbreviation()); 845e933c21SGreg Roach self::assertSame('P. trv.', $columns[14]->abbreviation()); 855e933c21SGreg Roach self::assertSame('Vz. doč.', $columns[15]->abbreviation()); 865e933c21SGreg Roach self::assertSame('Vz. dlho.', $columns[16]->abbreviation()); 875e933c21SGreg Roach self::assertSame('Čít.', $columns[17]->abbreviation()); 885e933c21SGreg Roach self::assertSame('Pís.', $columns[18]->abbreviation()); 895e933c21SGreg Roach self::assertSame('Poz.', $columns[19]->abbreviation()); 90c18c4744SGreg Roach 915e933c21SGreg Roach self::assertSame('Poradové číslo bytu', $columns[0]->title()); 925e933c21SGreg Roach self::assertSame('Poradové číslo osoby', $columns[1]->title()); 935e933c21SGreg Roach self::assertSame('Priezvisko a krstné meno, titul', $columns[2]->title()); 945e933c21SGreg Roach self::assertSame('Postavenie (rodinný vzťah k hlave domácnosti)', $columns[3]->title()); 955e933c21SGreg Roach self::assertSame('Pohlavie', $columns[4]->title()); 965e933c21SGreg Roach self::assertSame('Rok narodenia', $columns[5]->title()); 975e933c21SGreg Roach self::assertSame('Náboženstvo', $columns[6]->title()); 985e933c21SGreg Roach self::assertSame('Rodinský stav', $columns[7]->title()); 995e933c21SGreg Roach self::assertSame('Povolanie', $columns[8]->title()); 1005e933c21SGreg Roach self::assertSame('Okolnosti zamestnania', $columns[9]->title()); 1015e933c21SGreg Roach self::assertSame('Rodisko - štát/krajina, stolica/okres/sídlo/vidiek, mesto/obec', $columns[10]->title()); 1025e933c21SGreg Roach self::assertSame('Príslušnosť k obci - zdejší', $columns[11]->title()); 1035e933c21SGreg Roach self::assertSame('Príslušnosť k obci - cudzí', $columns[12]->title()); 1045e933c21SGreg Roach self::assertSame('Prítomný dočasne - do jedného mesiaca', $columns[13]->title()); 1055e933c21SGreg Roach self::assertSame('Prítomný trvalo', $columns[14]->title()); 1065e933c21SGreg Roach self::assertSame('Vzdialený dočasne - do jedného mesiaca', $columns[15]->title()); 1075e933c21SGreg Roach self::assertSame('Vzdialený dlhodobo - nad jeden mesiac', $columns[16]->title()); 1085e933c21SGreg Roach self::assertSame('Osoba vie čítať', $columns[17]->title()); 1095e933c21SGreg Roach self::assertSame('Osoba vie čítať a písať', $columns[18]->title()); 1105e933c21SGreg Roach self::assertSame('Poznámka', $columns[19]->title()); 111c18c4744SGreg Roach } 112c18c4744SGreg Roach} 113