1*3e615db9SGreg Roach<?php 2*3e615db9SGreg Roach 3*3e615db9SGreg Roach/** 4*3e615db9SGreg Roach * webtrees: online genealogy 5*3e615db9SGreg Roach * Copyright (C) 2016 webtrees development team 6*3e615db9SGreg Roach * This program is free software: you can redistribute it and/or modify 7*3e615db9SGreg Roach * it under the terms of the GNU General Public License as published by 8*3e615db9SGreg Roach * the Free Software Foundation, either version 3 of the License, or 9*3e615db9SGreg Roach * (at your option) any later version. 10*3e615db9SGreg Roach * This program is distributed in the hope that it will be useful, 11*3e615db9SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 12*3e615db9SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13*3e615db9SGreg Roach * GNU General Public License for more details. 14*3e615db9SGreg Roach * You should have received a copy of the GNU General Public License 15*3e615db9SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 16*3e615db9SGreg Roach */ 17*3e615db9SGreg Roachnamespace Fisharebest\Webtrees\Census; 18*3e615db9SGreg Roach 19*3e615db9SGreg Roach/** 20*3e615db9SGreg Roach * Test harness for the class CensusOfUnitedStates1820 21*3e615db9SGreg Roach */ 22*3e615db9SGreg Roachclass CensusOfUnitedStates1820Test extends \PHPUnit_Framework_TestCase { 23*3e615db9SGreg Roach /** 24*3e615db9SGreg Roach * Test the census place and date 25*3e615db9SGreg Roach * 26*3e615db9SGreg Roach * @covers Fisharebest\Webtrees\Census\CensusOfUnitedStates1820 27*3e615db9SGreg Roach */ 28*3e615db9SGreg Roach public function testPlaceAndDate() { 29*3e615db9SGreg Roach $census = new CensusOfUnitedStates1820; 30*3e615db9SGreg Roach 31*3e615db9SGreg Roach $this->assertSame('United States', $census->censusPlace()); 32*3e615db9SGreg Roach $this->assertSame('07 AUG 1820', $census->censusDate()); 33*3e615db9SGreg Roach } 34*3e615db9SGreg Roach 35*3e615db9SGreg Roach /** 36*3e615db9SGreg Roach * Test the census columns 37*3e615db9SGreg Roach * 38*3e615db9SGreg Roach * @covers Fisharebest\Webtrees\Census\CensusOfUnitedStates1820 39*3e615db9SGreg Roach * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn 40*3e615db9SGreg Roach */ 41*3e615db9SGreg Roach public function testColumns() { 42*3e615db9SGreg Roach $census = new CensusOfUnitedStates1820; 43*3e615db9SGreg Roach $columns = $census->columns(); 44*3e615db9SGreg Roach 45*3e615db9SGreg Roach $this->assertCount(32, $columns); 46*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnFullName', $columns[0]); 47*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[1]); 48*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[2]); 49*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[3]); 50*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[4]); 51*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[5]); 52*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[6]); 53*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]); 54*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[8]); 55*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[9]); 56*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[10]); 57*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[11]); 58*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[12]); 59*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[13]); 60*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[14]); 61*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[15]); 62*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[16]); 63*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[17]); 64*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[18]); 65*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[19]); 66*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[20]); 67*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[21]); 68*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[22]); 69*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[23]); 70*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[24]); 71*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[25]); 72*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[26]); 73*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[27]); 74*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[28]); 75*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[29]); 76*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[30]); 77*3e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[31]); 78*3e615db9SGreg Roach 79*3e615db9SGreg Roach $this->assertSame('Name', $columns[0]->abbreviation()); 80*3e615db9SGreg Roach $this->assertSame('M0-10', $columns[1]->abbreviation()); 81*3e615db9SGreg Roach $this->assertSame('M10-16', $columns[2]->abbreviation()); 82*3e615db9SGreg Roach $this->assertSame('M16-18', $columns[3]->abbreviation()); 83*3e615db9SGreg Roach $this->assertSame('M16-26', $columns[4]->abbreviation()); 84*3e615db9SGreg Roach $this->assertSame('M26-45', $columns[5]->abbreviation()); 85*3e615db9SGreg Roach $this->assertSame('M45+', $columns[6]->abbreviation()); 86*3e615db9SGreg Roach $this->assertSame('F0-10', $columns[7]->abbreviation()); 87*3e615db9SGreg Roach $this->assertSame('F10-16', $columns[8]->abbreviation()); 88*3e615db9SGreg Roach $this->assertSame('F16-26', $columns[9]->abbreviation()); 89*3e615db9SGreg Roach $this->assertSame('F26-45', $columns[10]->abbreviation()); 90*3e615db9SGreg Roach $this->assertSame('F45+', $columns[11]->abbreviation()); 91*3e615db9SGreg Roach $this->assertSame('FNR', $columns[12]->abbreviation()); 92*3e615db9SGreg Roach $this->assertSame('AG', $columns[13]->abbreviation()); 93*3e615db9SGreg Roach $this->assertSame('COM', $columns[14]->abbreviation()); 94*3e615db9SGreg Roach $this->assertSame('MNF', $columns[15]->abbreviation()); 95*3e615db9SGreg Roach $this->assertSame('M0', $columns[16]->abbreviation()); 96*3e615db9SGreg Roach $this->assertSame('M14', $columns[17]->abbreviation()); 97*3e615db9SGreg Roach $this->assertSame('M26', $columns[18]->abbreviation()); 98*3e615db9SGreg Roach $this->assertSame('M45', $columns[19]->abbreviation()); 99*3e615db9SGreg Roach $this->assertSame('F0', $columns[20]->abbreviation()); 100*3e615db9SGreg Roach $this->assertSame('F14', $columns[21]->abbreviation()); 101*3e615db9SGreg Roach $this->assertSame('F26', $columns[22]->abbreviation()); 102*3e615db9SGreg Roach $this->assertSame('F45', $columns[23]->abbreviation()); 103*3e615db9SGreg Roach $this->assertSame('M0', $columns[24]->abbreviation()); 104*3e615db9SGreg Roach $this->assertSame('M14', $columns[25]->abbreviation()); 105*3e615db9SGreg Roach $this->assertSame('M26', $columns[26]->abbreviation()); 106*3e615db9SGreg Roach $this->assertSame('M45', $columns[27]->abbreviation()); 107*3e615db9SGreg Roach $this->assertSame('F0', $columns[28]->abbreviation()); 108*3e615db9SGreg Roach $this->assertSame('F14', $columns[29]->abbreviation()); 109*3e615db9SGreg Roach $this->assertSame('F26', $columns[30]->abbreviation()); 110*3e615db9SGreg Roach $this->assertSame('F45', $columns[31]->abbreviation()); 111*3e615db9SGreg Roach 112*3e615db9SGreg Roach $this->assertSame('Name of head of family', $columns[0]->title()); 113*3e615db9SGreg Roach $this->assertSame('Free white males 0-10 years', $columns[1]->title()); 114*3e615db9SGreg Roach $this->assertSame('Free white males 10-16 years', $columns[2]->title()); 115*3e615db9SGreg Roach $this->assertSame('Free white males 16-18 years', $columns[3]->title()); 116*3e615db9SGreg Roach $this->assertSame('Free white males 16-26 years', $columns[4]->title()); 117*3e615db9SGreg Roach $this->assertSame('Free white males 26-45 years', $columns[5]->title()); 118*3e615db9SGreg Roach $this->assertSame('Free white males 45+ years', $columns[6]->title()); 119*3e615db9SGreg Roach $this->assertSame('Free white females 0-10 years', $columns[7]->title()); 120*3e615db9SGreg Roach $this->assertSame('Free white females 10-16 years', $columns[8]->title()); 121*3e615db9SGreg Roach $this->assertSame('Free white females 16-26 years', $columns[9]->title()); 122*3e615db9SGreg Roach $this->assertSame('Free white females 26-45 years', $columns[10]->title()); 123*3e615db9SGreg Roach $this->assertSame('Free white females 45+ years', $columns[11]->title()); 124*3e615db9SGreg Roach $this->assertSame('Foreigners not naturalized', $columns[12]->title()); 125*3e615db9SGreg Roach $this->assertSame('No. engaged in agriculture', $columns[13]->title()); 126*3e615db9SGreg Roach $this->assertSame('No. engaged in commerce', $columns[14]->title()); 127*3e615db9SGreg Roach $this->assertSame('No. engaged in manufactures', $columns[15]->title()); 128*3e615db9SGreg Roach $this->assertSame('Slave males 0-14 years', $columns[16]->title()); 129*3e615db9SGreg Roach $this->assertSame('Slave males 14-26 years', $columns[17]->title()); 130*3e615db9SGreg Roach $this->assertSame('Slave males 26-45 years', $columns[18]->title()); 131*3e615db9SGreg Roach $this->assertSame('Slave males 45+ years', $columns[19]->title()); 132*3e615db9SGreg Roach $this->assertSame('Slave females 0-14 years', $columns[20]->title()); 133*3e615db9SGreg Roach $this->assertSame('Slave females 14-26 years', $columns[21]->title()); 134*3e615db9SGreg Roach $this->assertSame('Slave females 26-45 years', $columns[22]->title()); 135*3e615db9SGreg Roach $this->assertSame('Slave females 45+ years', $columns[23]->title()); 136*3e615db9SGreg Roach $this->assertSame('Free colored males 0-14 years', $columns[24]->title()); 137*3e615db9SGreg Roach $this->assertSame('Free colored males 14-26 years', $columns[25]->title()); 138*3e615db9SGreg Roach $this->assertSame('Free colored males 26-45 years', $columns[26]->title()); 139*3e615db9SGreg Roach $this->assertSame('Free colored males 45+ years', $columns[27]->title()); 140*3e615db9SGreg Roach $this->assertSame('Free colored females 0-14 years', $columns[28]->title()); 141*3e615db9SGreg Roach $this->assertSame('Free colored females 14-26 years', $columns[29]->title()); 142*3e615db9SGreg Roach $this->assertSame('Free colored females 26-45 years', $columns[30]->title()); 143*3e615db9SGreg Roach $this->assertSame('Free colored females 45+ years', $columns[31]->title()); 144*3e615db9SGreg Roach } 145*3e615db9SGreg Roach} 146