16de2fb6bSKirk Gartside<?php 26de2fb6bSKirk Gartside 36de2fb6bSKirk Gartside/** 46de2fb6bSKirk Gartside * webtrees: online genealogy 5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team 66de2fb6bSKirk Gartside * This program is free software: you can redistribute it and/or modify 76de2fb6bSKirk Gartside * it under the terms of the GNU General Public License as published by 86de2fb6bSKirk Gartside * the Free Software Foundation, either version 3 of the License, or 96de2fb6bSKirk Gartside * (at your option) any later version. 106de2fb6bSKirk Gartside * This program is distributed in the hope that it will be useful, 116de2fb6bSKirk Gartside * but WITHOUT ANY WARRANTY; without even the implied warranty of 126de2fb6bSKirk Gartside * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 136de2fb6bSKirk Gartside * GNU General Public License for more details. 146de2fb6bSKirk Gartside * You should have received a copy of the GNU General Public License 156de2fb6bSKirk Gartside * along with this program. If not, see <https://www.gnu.org/licenses/>. 166de2fb6bSKirk Gartside */ 176de2fb6bSKirk Gartside 186de2fb6bSKirk Gartsidedeclare(strict_types=1); 196de2fb6bSKirk Gartside 206de2fb6bSKirk Gartsidenamespace Fisharebest\Webtrees\Census; 216de2fb6bSKirk Gartside 226de2fb6bSKirk Gartsideuse Fisharebest\Webtrees\TestCase; 23*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass; 246de2fb6bSKirk Gartside 25*202c018bSGreg Roach#[CoversClass(CensusOfRhodeIsland1905::class)] 26*202c018bSGreg Roach#[CoversClass(AbstractCensusColumn::class)] 276de2fb6bSKirk Gartsideclass CensusOfRhodeIsland1905Test extends TestCase 286de2fb6bSKirk Gartside{ 296de2fb6bSKirk Gartside /** 306de2fb6bSKirk Gartside * Test the census place and date 316de2fb6bSKirk Gartside */ 326de2fb6bSKirk Gartside public function testPlaceAndDate(): void 336de2fb6bSKirk Gartside { 346de2fb6bSKirk Gartside $census = new CensusOfRhodeIsland1905(); 356de2fb6bSKirk Gartside 366de2fb6bSKirk Gartside self::assertSame('Rhode Island, United States', $census->censusPlace()); 376de2fb6bSKirk Gartside self::assertSame('JUN 1905', $census->censusDate()); 386de2fb6bSKirk Gartside } 396de2fb6bSKirk Gartside 406de2fb6bSKirk Gartside /** 416de2fb6bSKirk Gartside * Test the census columns 426de2fb6bSKirk Gartside */ 436de2fb6bSKirk Gartside public function testColumns(): void 446de2fb6bSKirk Gartside { 456de2fb6bSKirk Gartside $census = new CensusOfRhodeIsland1905(); 466de2fb6bSKirk Gartside $columns = $census->columns(); 476de2fb6bSKirk Gartside self::assertCount(28, $columns); 486de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnSexMF::class, $columns[0]); 496de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[1]); 506de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnSurnameGivenNameInitial::class, $columns[2]); 516de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnRelationToHeadEnglish::class, $columns[3]); 526de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[4]); 536de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnAge::class, $columns[5]); 546de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnConditionUs::class, $columns[6]); 556de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnBirthYear::class, $columns[7]); 566de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnBirthMonthDay::class, $columns[8]); 576de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnBirthPlaceSimple::class, $columns[9]); 586de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[10]); 596de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[11]); 606de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[12]); 616de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[13]); 626de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[14]); 636de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[15]); 646de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[16]); 656de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[17]); 666de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnMotherBirthPlaceSimple::class, $columns[18]); 676de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnOccupation::class, $columns[19]); 686de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[20]); 696de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[21]); 706de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnReligion::class, $columns[22]); 716de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[23]); 726de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[24]); 736de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnNull::class, $columns[25]); 746de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnChildrenBornAlive::class, $columns[26]); 756de2fb6bSKirk Gartside self::assertInstanceOf(CensusColumnChildrenLiving::class, $columns[27]); 766de2fb6bSKirk Gartside 776de2fb6bSKirk Gartside self::assertSame('Sex', $columns[0]->abbreviation()); 786de2fb6bSKirk Gartside self::assertSame('Num', $columns[1]->abbreviation()); 796de2fb6bSKirk Gartside self::assertSame('Name', $columns[2]->abbreviation()); 806de2fb6bSKirk Gartside self::assertSame('Relation', $columns[3]->abbreviation()); 816de2fb6bSKirk Gartside self::assertSame('Race', $columns[4]->abbreviation()); 826de2fb6bSKirk Gartside self::assertSame('Age', $columns[5]->abbreviation()); 836de2fb6bSKirk Gartside self::assertSame('Cond', $columns[6]->abbreviation()); 846de2fb6bSKirk Gartside self::assertSame('Year', $columns[7]->abbreviation()); 856de2fb6bSKirk Gartside self::assertSame('Month Day', $columns[8]->abbreviation()); 866de2fb6bSKirk Gartside self::assertSame('BP', $columns[9]->abbreviation()); 876de2fb6bSKirk Gartside self::assertSame('N/F', $columns[10]->abbreviation()); 886de2fb6bSKirk Gartside self::assertSame('R', $columns[11]->abbreviation()); 896de2fb6bSKirk Gartside self::assertSame('W', $columns[12]->abbreviation()); 906de2fb6bSKirk Gartside self::assertSame('Imm', $columns[13]->abbreviation()); 916de2fb6bSKirk Gartside self::assertSame('US yrs', $columns[14]->abbreviation()); 926de2fb6bSKirk Gartside self::assertSame('RI yrs', $columns[15]->abbreviation()); 936de2fb6bSKirk Gartside self::assertSame('Town mnths', $columns[16]->abbreviation()); 946de2fb6bSKirk Gartside self::assertSame('FBP', $columns[17]->abbreviation()); 956de2fb6bSKirk Gartside self::assertSame('MBP', $columns[18]->abbreviation()); 966de2fb6bSKirk Gartside self::assertSame('Occupation', $columns[19]->abbreviation()); 976de2fb6bSKirk Gartside self::assertSame('Unemp', $columns[20]->abbreviation()); 986de2fb6bSKirk Gartside self::assertSame('Pen', $columns[21]->abbreviation()); 996de2fb6bSKirk Gartside self::assertSame('Rel', $columns[22]->abbreviation()); 1006de2fb6bSKirk Gartside self::assertSame('Mil', $columns[23]->abbreviation()); 1016de2fb6bSKirk Gartside self::assertSame('Nat', $columns[24]->abbreviation()); 1026de2fb6bSKirk Gartside self::assertSame('Vtr', $columns[25]->abbreviation()); 1036de2fb6bSKirk Gartside self::assertSame('Chil born', $columns[26]->abbreviation()); 1046de2fb6bSKirk Gartside self::assertSame('Chil liv', $columns[27]->abbreviation()); 1056de2fb6bSKirk Gartside 1066de2fb6bSKirk Gartside self::assertSame('Sex', $columns[0]->title()); 1076de2fb6bSKirk Gartside self::assertSame('Number of people in the family', $columns[1]->title()); 1086de2fb6bSKirk Gartside self::assertSame('Name', $columns[2]->title()); 1096de2fb6bSKirk Gartside self::assertSame('Relationship to head of household', $columns[3]->title()); 1106de2fb6bSKirk Gartside self::assertSame('Color or race', $columns[4]->title()); 1116de2fb6bSKirk Gartside self::assertSame('Age at last birthday', $columns[5]->title()); 1126de2fb6bSKirk Gartside self::assertSame('Congugal Condition', $columns[6]->title()); 1136de2fb6bSKirk Gartside self::assertSame('Year of Birth', $columns[7]->title()); 1146de2fb6bSKirk Gartside self::assertSame('Month Day', $columns[8]->title()); 1156de2fb6bSKirk Gartside self::assertSame('Place of birth', $columns[9]->title()); 1166de2fb6bSKirk Gartside self::assertSame('Native or Foreign Born', $columns[10]->title()); 1176de2fb6bSKirk Gartside self::assertSame('Read', $columns[11]->title()); 1186de2fb6bSKirk Gartside self::assertSame('Write', $columns[12]->title()); 1196de2fb6bSKirk Gartside self::assertSame('Year of immigration to the United States', $columns[13]->title()); 1206de2fb6bSKirk Gartside self::assertSame('Years in US', $columns[14]->title()); 1216de2fb6bSKirk Gartside self::assertSame('Years resident of Rhode Island', $columns[15]->title()); 1226de2fb6bSKirk Gartside self::assertSame('Months in current year as a Rhode Island resident', $columns[16]->title()); 1236de2fb6bSKirk Gartside self::assertSame('Place of birth of father of this person', $columns[17]->title()); 1246de2fb6bSKirk Gartside self::assertSame('Place of birth of mother of this person', $columns[18]->title()); 1256de2fb6bSKirk Gartside self::assertSame('Occupation', $columns[19]->title()); 1266de2fb6bSKirk Gartside self::assertSame('Months unemployed during Census Year', $columns[20]->title()); 1276de2fb6bSKirk Gartside self::assertSame('Did you receive a pension', $columns[21]->title()); 1286de2fb6bSKirk Gartside self::assertSame('Religious preference', $columns[22]->title()); 1296de2fb6bSKirk Gartside self::assertSame('Military or widow of military', $columns[23]->title()); 1306de2fb6bSKirk Gartside self::assertSame('Naturalization information', $columns[24]->title()); 1316de2fb6bSKirk Gartside self::assertSame('Voter information', $columns[25]->title()); 1326de2fb6bSKirk Gartside self::assertSame('Mother of how many children', $columns[26]->title()); 1336de2fb6bSKirk Gartside self::assertSame('Number of these children living on June 1 1905', $columns[27]->title()); 1346de2fb6bSKirk Gartside } 1356de2fb6bSKirk Gartside} 136