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(CensusOfSlovakia1940::class)] 26*202c018bSGreg Roach#[CoversClass(AbstractCensusColumn::class)] 2719968c02SGreg Roachclass CensusOfSlovakia1940Test 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 CensusOfSlovakia1940(); 3519968c02SGreg Roach 3619968c02SGreg Roach self::assertSame('Slovensko', $census->censusPlace()); 3719968c02SGreg Roach self::assertSame('14 DEC 1940', $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 CensusOfSlovakia1940(); 4619968c02SGreg Roach $columns = $census->columns(); 4719968c02SGreg Roach 4819968c02SGreg Roach self::assertCount(22, $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(CensusColumnBirthPlace::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(CensusColumnNull::class, $columns[12]); 6219968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[13]); 6319968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[14]); 6419968c02SGreg Roach self::assertInstanceOf(CensusColumnReligion::class, $columns[15]); 6519968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[16]); 6619968c02SGreg Roach self::assertInstanceOf(CensusColumnOccupation::class, $columns[17]); 6719968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[18]); 6819968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[19]); 6919968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[20]); 7019968c02SGreg Roach self::assertInstanceOf(CensusColumnNull::class, $columns[21]); 7119968c02SGreg Roach 7219968c02SGreg Roach self::assertSame('Č. b.', $columns[0]->abbreviation()); 7319968c02SGreg Roach self::assertSame('Č. os.', $columns[1]->abbreviation()); 7419968c02SGreg Roach self::assertSame('Priezvisko', $columns[2]->abbreviation()); 7519968c02SGreg Roach self::assertSame('Meno', $columns[3]->abbreviation()); 7619968c02SGreg Roach self::assertSame('Pomer', $columns[4]->abbreviation()); 7719968c02SGreg Roach self::assertSame('Poh.', $columns[5]->abbreviation()); 7819968c02SGreg Roach self::assertSame('Nar.', $columns[6]->abbreviation()); 7919968c02SGreg Roach self::assertSame('Stav', $columns[7]->abbreviation()); 8019968c02SGreg Roach self::assertSame('Rodisko', $columns[8]->abbreviation()); 8119968c02SGreg Roach self::assertSame('P. trv.', $columns[9]->abbreviation()); 8219968c02SGreg Roach self::assertSame('Byd. doč.', $columns[10]->abbreviation()); 8319968c02SGreg Roach self::assertSame('Dát. prisťahovania', $columns[11]->abbreviation()); 8419968c02SGreg Roach self::assertSame('Odkiaľ', $columns[12]->abbreviation()); 8519968c02SGreg Roach self::assertSame('Príslušnosť', $columns[13]->abbreviation()); 8619968c02SGreg Roach self::assertSame('Národnosť', $columns[14]->abbreviation()); 8719968c02SGreg Roach self::assertSame('Náb.', $columns[15]->abbreviation()); 8819968c02SGreg Roach self::assertSame('Čít./Pís.', $columns[16]->abbreviation()); 8919968c02SGreg Roach self::assertSame('Povolanie', $columns[17]->abbreviation()); 9019968c02SGreg Roach self::assertSame('Postavenie', $columns[18]->abbreviation()); 9119968c02SGreg Roach self::assertSame('Závod', $columns[19]->abbreviation()); 9219968c02SGreg Roach self::assertSame('Odvetvie', $columns[20]->abbreviation()); 9319968c02SGreg Roach self::assertSame('Poz.', $columns[21]->abbreviation()); 9419968c02SGreg Roach 9519968c02SGreg Roach self::assertSame('Radové číslo bytu', $columns[0]->title()); 9619968c02SGreg Roach self::assertSame('Radové číslo osôb v byte', $columns[1]->title()); 9719968c02SGreg Roach self::assertSame('Priezvisko (meno rodinné)', $columns[2]->title()); 9819968c02SGreg Roach self::assertSame('Meno (krstné alebo rodné)', $columns[3]->title()); 9919968c02SGreg Roach self::assertSame('Príbuzenský alebo iný pomer k hlave domácnosti', $columns[4]->title()); 10019968c02SGreg Roach self::assertSame('Pohlavie mužské alebo ženské', $columns[5]->title()); 10119968c02SGreg Roach self::assertSame('Deň, mesiac a rok narodenia', $columns[6]->title()); 10219968c02SGreg Roach self::assertSame('Rodinný stav', $columns[7]->title()); 10319968c02SGreg Roach self::assertSame('a) rodná obec, b) okres', $columns[8]->title()); 10419968c02SGreg Roach self::assertSame('Je sčítaný v obci prítomný trvale?', $columns[9]->title()); 10519968c02SGreg Roach self::assertSame('Ak dočasne, nech uvedie svoje riadne bydlisko', $columns[10]->title()); 10619968c02SGreg Roach self::assertSame('Ak sčítaný nebýva v obci pobytu od narodenia, kedy sa prisťahoval', $columns[11]->title()); 10719968c02SGreg Roach self::assertSame('Ak sčítaný nebýva v obci pobytu od narodenia, odkiaľ sa prisťahoval', $columns[12]->title()); 10819968c02SGreg Roach self::assertSame('Státna príslušnosť', $columns[13]->title()); 10919968c02SGreg Roach self::assertSame('Národnosť', $columns[14]->title()); 11019968c02SGreg Roach self::assertSame('Náboženstvo (cirkevná príslušnosť alebo bez vyznania', $columns[15]->title()); 11119968c02SGreg Roach self::assertSame('Znalosť čítania a písania len u osôb starších 6tich rokov', $columns[16]->title()); 11219968c02SGreg Roach self::assertSame('Druh povolania', $columns[17]->title()); 11319968c02SGreg Roach self::assertSame('Postavenie v povolaní', $columns[18]->title()); 11419968c02SGreg Roach self::assertSame('Názov a sídlo závodu (firmy, úradu)', $columns[19]->title()); 11519968c02SGreg Roach self::assertSame('K akému odvetviu patrí závod (firma, úrad)', $columns[20]->title()); 11619968c02SGreg Roach self::assertSame('Poznámka', $columns[21]->title()); 11719968c02SGreg Roach } 11819968c02SGreg Roach} 119