119968c02SGreg Roach<?php 219968c02SGreg Roach 319968c02SGreg Roach/** 419968c02SGreg Roach * webtrees: online genealogy 5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team 619968c02SGreg Roach * This program is free software: you can redistribute it and/or modify 719968c02SGreg Roach * it under the terms of the GNU General Public License as published by 819968c02SGreg Roach * the Free Software Foundation, either version 3 of the License, or 919968c02SGreg Roach * (at your option) any later version. 1019968c02SGreg Roach * This program is distributed in the hope that it will be useful, 1119968c02SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 1219968c02SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1319968c02SGreg Roach * GNU General Public License for more details. 1419968c02SGreg Roach * You should have received a copy of the GNU General Public License 1519968c02SGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>. 1619968c02SGreg Roach */ 1719968c02SGreg Roach 1819968c02SGreg Roachdeclare(strict_types=1); 1919968c02SGreg Roach 2019968c02SGreg Roachnamespace Fisharebest\Webtrees\Census; 2119968c02SGreg Roach 2219968c02SGreg Roachuse Fisharebest\Webtrees\TestCase; 23*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass; 2419968c02SGreg Roach 25*202c018bSGreg Roach#[CoversClass(CensusOfSlovakia1930::class)] 26*202c018bSGreg Roach#[CoversClass(AbstractCensusColumn::class)] 2719968c02SGreg Roachclass CensusOfSlovakia1930Test extends TestCase 2819968c02SGreg Roach{ 2919968c02SGreg Roach /** 3019968c02SGreg Roach * Test the census place and date 3119968c02SGreg Roach */ 3219968c02SGreg Roach public function testPlaceAndDate(): void 3319968c02SGreg Roach { 3419968c02SGreg Roach $census = new CensusOfSlovakia1930(); 3519968c02SGreg Roach 3619968c02SGreg Roach self::assertSame('Slovensko', $census->censusPlace()); 3719968c02SGreg Roach self::assertSame('01 DEC 1930', $census->censusDate()); 3819968c02SGreg Roach } 3919968c02SGreg Roach 4019968c02SGreg Roach /** 4119968c02SGreg Roach * Test the census columns 4219968c02SGreg Roach */ 4319968c02SGreg Roach public function testColumns(): void 4419968c02SGreg Roach { 4519968c02SGreg Roach $census = new CensusOfSlovakia1930(); 4619968c02SGreg Roach $columns = $census->columns(); 4719968c02SGreg Roach 4819968c02SGreg Roach self::assertCount(27, $columns); 4919968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[0]); 5019968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[1]); 5119968c02SGreg Roach self::assertInstanceOf(CensusColumnSurname::class, $columns[2]); 5219968c02SGreg Roach self::assertInstanceOf(CensusColumnGivenNames::class, $columns[3]); 5319968c02SGreg Roach self::assertInstanceOf(CensusColumnRelationToHead::class, $columns[4]); 5419968c02SGreg Roach self::assertInstanceOf(CensusColumnSexMZ::class, $columns[5]); 5519968c02SGreg Roach self::assertInstanceOf(CensusColumnBirthDayDotMonthYear::class, $columns[6]); 5619968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[7]); 5719968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[8]); 5819968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[9]); 5919968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[10]); 6019968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[11]); 6119968c02SGreg Roach self::assertInstanceOf(CensusColumnBirthPlace::class, $columns[12]); 6219968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[13]); 6319968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[14]); 6419968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[15]); 6519968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[16]); 6619968c02SGreg Roach self::assertInstanceOf(CensusColumnReligion::class, $columns[17]); 6719968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[18]); 6819968c02SGreg Roach self::assertInstanceOf(CensusColumnOccupation::class, $columns[19]); 6919968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[20]); 7019968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[21]); 7119968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[22]); 7219968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[23]); 7319968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[24]); 7419968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[25]); 7519968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[26]); 7619968c02SGreg Roach 7719968c02SGreg Roach self::assertSame('Č. b.', $columns[0]->abbreviation()); 7819968c02SGreg Roach self::assertSame('Č. os.', $columns[1]->abbreviation()); 7919968c02SGreg Roach self::assertSame('Priezvisko', $columns[2]->abbreviation()); 8019968c02SGreg Roach self::assertSame('Meno', $columns[3]->abbreviation()); 8119968c02SGreg Roach self::assertSame('Pomer', $columns[4]->abbreviation()); 8219968c02SGreg Roach self::assertSame('Poh.', $columns[5]->abbreviation()); 8319968c02SGreg Roach self::assertSame('Nar.', $columns[6]->abbreviation()); 8419968c02SGreg Roach self::assertSame('Stav', $columns[7]->abbreviation()); 8519968c02SGreg Roach self::assertSame('Dát. sňatku', $columns[8]->abbreviation()); 8619968c02SGreg Roach self::assertSame('Dát. ovodv.', $columns[9]->abbreviation()); 8719968c02SGreg Roach self::assertSame('Poč. detí', $columns[10]->abbreviation()); 8819968c02SGreg Roach self::assertSame('Zomrelo', $columns[11]->abbreviation()); 8919968c02SGreg Roach self::assertSame('Rodisko', $columns[12]->abbreviation()); 9019968c02SGreg Roach self::assertSame('Dát. prisťahovania', $columns[13]->abbreviation()); 9119968c02SGreg Roach self::assertSame('Odkiaľ', $columns[14]->abbreviation()); 9219968c02SGreg Roach self::assertSame('Príslušnosť', $columns[15]->abbreviation()); 9319968c02SGreg Roach self::assertSame('Národnosť', $columns[16]->abbreviation()); 9419968c02SGreg Roach self::assertSame('Náb.', $columns[17]->abbreviation()); 9519968c02SGreg Roach self::assertSame('Čít./Pís.', $columns[18]->abbreviation()); 9619968c02SGreg Roach self::assertSame('Povolanie', $columns[19]->abbreviation()); 9719968c02SGreg Roach self::assertSame('Postavenie', $columns[20]->abbreviation()); 9819968c02SGreg Roach self::assertSame('Závod', $columns[21]->abbreviation()); 9919968c02SGreg Roach self::assertSame('P. trv.', $columns[22]->abbreviation()); 10019968c02SGreg Roach self::assertSame('Byd. doč.', $columns[23]->abbreviation()); 10119968c02SGreg Roach self::assertSame('P. doč.', $columns[24]->abbreviation()); 10219968c02SGreg Roach self::assertSame('Vady', $columns[25]->abbreviation()); 10319968c02SGreg Roach self::assertSame('Poz.', $columns[26]->abbreviation()); 10419968c02SGreg Roach 10519968c02SGreg Roach self::assertSame('Radové číslo bytu', $columns[0]->title()); 10619968c02SGreg Roach self::assertSame('Radové číslo osôb v dome', $columns[1]->title()); 10719968c02SGreg Roach self::assertSame('Priezvisko (meno rodinné)', $columns[2]->title()); 10819968c02SGreg Roach self::assertSame('Meno (krstné alebo rodné)', $columns[3]->title()); 10919968c02SGreg Roach self::assertSame('Príbuzenský alebo iný pomer k prednostovi domácnosti', $columns[4]->title()); 11019968c02SGreg Roach self::assertSame('Pohlavie (či mužské či ženské', $columns[5]->title()); 11119968c02SGreg Roach self::assertSame('Deň, mesiac a rok narodenia', $columns[6]->title()); 11219968c02SGreg Roach self::assertSame('Rodinný stav', $columns[7]->title()); 11319968c02SGreg Roach self::assertSame('U žien, ktoré sú alebo boly vydaté dátum posledného sňatku', $columns[8]->title()); 11419968c02SGreg Roach self::assertSame('u ovdov. žien dátum ovdovenia, u rozvedených a rozlúčených dátum rozvodu alebo rozluky', $columns[9]->title()); 11519968c02SGreg Roach self::assertSame('U žien, ktoré sú alebo boly vydaté počet všetkých žive narodených detí v poslednom manželstve', $columns[10]->title()); 11619968c02SGreg Roach self::assertSame('z nich zomrelo', $columns[11]->title()); 11719968c02SGreg Roach self::assertSame('a) rodná obec, b) pol. okres, c) krajina', $columns[12]->title()); 11819968c02SGreg Roach self::assertSame('Jestliže sčítaný nebýva v obci pobytu od narodenia, kedy sa prisťahoval', $columns[13]->title()); 11919968c02SGreg Roach self::assertSame('Jestliže sčítaný nebýva v obci pobytu od narodenia, odkiaľ sa prisťahoval', $columns[14]->title()); 12019968c02SGreg Roach self::assertSame('Státna príslušnosť, u čsl. štátnych príslušníkov mimotoho tiež domovská príslušnosť', $columns[15]->title()); 12119968c02SGreg Roach self::assertSame('Národnosť (materský jazyk', $columns[16]->title()); 12219968c02SGreg Roach self::assertSame('Náboženské vyznanie (cirkevná príslušnosť alebo bez vyznania', $columns[17]->title()); 12319968c02SGreg Roach self::assertSame('Znalosť čítania a písania len u osôb starších 6tich rokov', $columns[18]->title()); 12419968c02SGreg Roach self::assertSame('druh povolania', $columns[19]->title()); 12519968c02SGreg Roach self::assertSame('postavenie v povolaní', $columns[20]->title()); 12619968c02SGreg Roach self::assertSame('bližšie označenie závodu a miesta závodu', $columns[21]->title()); 12719968c02SGreg Roach self::assertSame('Či je sčítaný v obci prítomný trvale alebo len dočasne', $columns[22]->title()); 12819968c02SGreg Roach self::assertSame('Jestliže dočasne, nech uvedie svoje riadne bydlisko', $columns[23]->title()); 12919968c02SGreg Roach self::assertSame('Prítomný dočasne - do jedného mesiaca', $columns[24]->title()); 13019968c02SGreg Roach self::assertSame('Telesné vady - či sčítaný je slepý na obe oči, hluchý, nemý, hluchonemý, či nemá ruku alebo nohu', $columns[25]->title()); 13119968c02SGreg Roach self::assertSame('Poznámka', $columns[26]->title()); 13219968c02SGreg Roach } 13319968c02SGreg Roach} 134