13e615db9SGreg Roach<?php 23e615db9SGreg Roach/** 33e615db9SGreg Roach * webtrees: online genealogy 41062a142SGreg Roach * Copyright (C) 2018 webtrees development team 53e615db9SGreg Roach * This program is free software: you can redistribute it and/or modify 63e615db9SGreg Roach * it under the terms of the GNU General Public License as published by 73e615db9SGreg Roach * the Free Software Foundation, either version 3 of the License, or 83e615db9SGreg Roach * (at your option) any later version. 93e615db9SGreg Roach * This program is distributed in the hope that it will be useful, 103e615db9SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 113e615db9SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 123e615db9SGreg Roach * GNU General Public License for more details. 133e615db9SGreg Roach * You should have received a copy of the GNU General Public License 143e615db9SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 153e615db9SGreg Roach */ 163e615db9SGreg Roachnamespace Fisharebest\Webtrees\Census; 173e615db9SGreg Roach 183e615db9SGreg Roach/** 193e615db9SGreg Roach * Test harness for the class CensusOfUnitedStates1830 203e615db9SGreg Roach */ 2184e2cf4eSGreg Roachclass CensusOfUnitedStates1830Test extends \Fisharebest\Webtrees\TestCase 22c1010edaSGreg Roach{ 233e615db9SGreg Roach /** 243e615db9SGreg Roach * Test the census place and date 253e615db9SGreg Roach * 2615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusOfUnitedStates1830 27*52348eb8SGreg Roach * 28*52348eb8SGreg Roach * @return void 293e615db9SGreg Roach */ 30c1010edaSGreg Roach public function testPlaceAndDate() 31c1010edaSGreg Roach { 323e615db9SGreg Roach $census = new CensusOfUnitedStates1830; 333e615db9SGreg Roach 343e615db9SGreg Roach $this->assertSame('United States', $census->censusPlace()); 353e615db9SGreg Roach $this->assertSame('01 JUN 1830', $census->censusDate()); 363e615db9SGreg Roach } 373e615db9SGreg Roach 383e615db9SGreg Roach /** 393e615db9SGreg Roach * Test the census columns 403e615db9SGreg Roach * 4115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusOfUnitedStates1830 4215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 43*52348eb8SGreg Roach * 44*52348eb8SGreg Roach * @return void 453e615db9SGreg Roach */ 46c1010edaSGreg Roach public function testColumns() 47c1010edaSGreg Roach { 483e615db9SGreg Roach $census = new CensusOfUnitedStates1830; 493e615db9SGreg Roach $columns = $census->columns(); 503e615db9SGreg Roach 513e615db9SGreg Roach $this->assertCount(51, $columns); 523e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnFullName', $columns[0]); 533e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[1]); 543e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[2]); 553e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[3]); 563e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[4]); 573e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[5]); 583e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[6]); 593e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]); 603e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[8]); 613e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[9]); 623e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[10]); 633e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[11]); 643e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[12]); 653e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[13]); 663e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[14]); 673e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[15]); 683e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[16]); 693e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[17]); 703e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[18]); 713e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[19]); 723e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[20]); 733e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[21]); 743e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[22]); 753e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[23]); 763e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[24]); 773e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[25]); 783e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[26]); 793e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[27]); 803e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[28]); 813e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[29]); 823e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[30]); 833e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[31]); 843e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[32]); 853e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[33]); 863e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[34]); 873e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[35]); 883e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[36]); 893e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[37]); 903e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[38]); 913e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[39]); 923e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[40]); 933e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[41]); 943e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[42]); 953e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[43]); 963e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[44]); 973e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[45]); 983e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[46]); 993e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[47]); 1003e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[48]); 1013e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[49]); 1023e615db9SGreg Roach $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[50]); 1033e615db9SGreg Roach 1043e615db9SGreg Roach $this->assertSame('Name', $columns[0]->abbreviation()); 1053e615db9SGreg Roach $this->assertSame('M0', $columns[1]->abbreviation()); 1063e615db9SGreg Roach $this->assertSame('M5', $columns[2]->abbreviation()); 1073e615db9SGreg Roach $this->assertSame('M10', $columns[3]->abbreviation()); 1083e615db9SGreg Roach $this->assertSame('M15', $columns[4]->abbreviation()); 1093e615db9SGreg Roach $this->assertSame('M20', $columns[5]->abbreviation()); 1103e615db9SGreg Roach $this->assertSame('M30', $columns[6]->abbreviation()); 1113e615db9SGreg Roach $this->assertSame('M40', $columns[7]->abbreviation()); 1123e615db9SGreg Roach $this->assertSame('M50', $columns[8]->abbreviation()); 1133e615db9SGreg Roach $this->assertSame('M60', $columns[9]->abbreviation()); 1143e615db9SGreg Roach $this->assertSame('M70', $columns[10]->abbreviation()); 1153e615db9SGreg Roach $this->assertSame('M80', $columns[11]->abbreviation()); 1163e615db9SGreg Roach $this->assertSame('M90', $columns[12]->abbreviation()); 1173e615db9SGreg Roach $this->assertSame('M100', $columns[13]->abbreviation()); 1183e615db9SGreg Roach $this->assertSame('F0', $columns[14]->abbreviation()); 1193e615db9SGreg Roach $this->assertSame('F5', $columns[15]->abbreviation()); 1203e615db9SGreg Roach $this->assertSame('F10', $columns[16]->abbreviation()); 1213e615db9SGreg Roach $this->assertSame('F15', $columns[17]->abbreviation()); 1223e615db9SGreg Roach $this->assertSame('F20', $columns[18]->abbreviation()); 1233e615db9SGreg Roach $this->assertSame('F30', $columns[19]->abbreviation()); 1243e615db9SGreg Roach $this->assertSame('F40', $columns[20]->abbreviation()); 1253e615db9SGreg Roach $this->assertSame('F50', $columns[21]->abbreviation()); 1263e615db9SGreg Roach $this->assertSame('F60', $columns[22]->abbreviation()); 1273e615db9SGreg Roach $this->assertSame('F70', $columns[23]->abbreviation()); 1283e615db9SGreg Roach $this->assertSame('F80', $columns[24]->abbreviation()); 1293e615db9SGreg Roach $this->assertSame('F90', $columns[25]->abbreviation()); 1303e615db9SGreg Roach $this->assertSame('F100', $columns[26]->abbreviation()); 1313e615db9SGreg Roach $this->assertSame('M0', $columns[27]->abbreviation()); 1323e615db9SGreg Roach $this->assertSame('M10', $columns[28]->abbreviation()); 1333e615db9SGreg Roach $this->assertSame('M24', $columns[29]->abbreviation()); 1343e615db9SGreg Roach $this->assertSame('M36', $columns[30]->abbreviation()); 1353e615db9SGreg Roach $this->assertSame('M55', $columns[31]->abbreviation()); 1363e615db9SGreg Roach $this->assertSame('M100', $columns[32]->abbreviation()); 1373e615db9SGreg Roach $this->assertSame('F0', $columns[33]->abbreviation()); 1383e615db9SGreg Roach $this->assertSame('F10', $columns[34]->abbreviation()); 1393e615db9SGreg Roach $this->assertSame('F24', $columns[35]->abbreviation()); 1403e615db9SGreg Roach $this->assertSame('F36', $columns[36]->abbreviation()); 1413e615db9SGreg Roach $this->assertSame('F55', $columns[37]->abbreviation()); 1423e615db9SGreg Roach $this->assertSame('F100', $columns[38]->abbreviation()); 1433e615db9SGreg Roach $this->assertSame('M0', $columns[39]->abbreviation()); 1443e615db9SGreg Roach $this->assertSame('M10', $columns[40]->abbreviation()); 1453e615db9SGreg Roach $this->assertSame('M24', $columns[41]->abbreviation()); 1463e615db9SGreg Roach $this->assertSame('M36', $columns[42]->abbreviation()); 1473e615db9SGreg Roach $this->assertSame('M55', $columns[43]->abbreviation()); 1483e615db9SGreg Roach $this->assertSame('M100', $columns[44]->abbreviation()); 1493e615db9SGreg Roach $this->assertSame('F0', $columns[45]->abbreviation()); 1503e615db9SGreg Roach $this->assertSame('F10', $columns[46]->abbreviation()); 1513e615db9SGreg Roach $this->assertSame('F24', $columns[47]->abbreviation()); 1523e615db9SGreg Roach $this->assertSame('F36', $columns[48]->abbreviation()); 1533e615db9SGreg Roach $this->assertSame('F55', $columns[49]->abbreviation()); 1543e615db9SGreg Roach $this->assertSame('F100', $columns[50]->abbreviation()); 1553e615db9SGreg Roach 1563e615db9SGreg Roach $this->assertSame('Name of head of family', $columns[0]->title()); 1573e615db9SGreg Roach $this->assertSame('Free white males 0-5 years', $columns[1]->title()); 1583e615db9SGreg Roach $this->assertSame('Free white males 5-10 years', $columns[2]->title()); 1593e615db9SGreg Roach $this->assertSame('Free white males 10-15 years', $columns[3]->title()); 1603e615db9SGreg Roach $this->assertSame('Free white males 15-20 years', $columns[4]->title()); 1613e615db9SGreg Roach $this->assertSame('Free white males 20-30 years', $columns[5]->title()); 1623e615db9SGreg Roach $this->assertSame('Free white males 30-40 years', $columns[6]->title()); 1633e615db9SGreg Roach $this->assertSame('Free white males 40-50 years', $columns[7]->title()); 1643e615db9SGreg Roach $this->assertSame('Free white males 50-60 years', $columns[8]->title()); 1653e615db9SGreg Roach $this->assertSame('Free white males 60-70 years', $columns[9]->title()); 1663e615db9SGreg Roach $this->assertSame('Free white males 70-80 years', $columns[10]->title()); 1673e615db9SGreg Roach $this->assertSame('Free white males 80-90 years', $columns[11]->title()); 1683e615db9SGreg Roach $this->assertSame('Free white males 90-100 years', $columns[12]->title()); 1693e615db9SGreg Roach $this->assertSame('Free white males 100+ years', $columns[13]->title()); 1703e615db9SGreg Roach $this->assertSame('Free white females 0-5 years', $columns[14]->title()); 1713e615db9SGreg Roach $this->assertSame('Free white females 5-10 years', $columns[15]->title()); 1723e615db9SGreg Roach $this->assertSame('Free white females 10-15 years', $columns[16]->title()); 1733e615db9SGreg Roach $this->assertSame('Free white females 15-20 years', $columns[17]->title()); 1743e615db9SGreg Roach $this->assertSame('Free white females 20-30 years', $columns[18]->title()); 1753e615db9SGreg Roach $this->assertSame('Free white females 30-40 years', $columns[19]->title()); 1763e615db9SGreg Roach $this->assertSame('Free white females 40-50 years', $columns[20]->title()); 1773e615db9SGreg Roach $this->assertSame('Free white females 50-60 years', $columns[21]->title()); 1783e615db9SGreg Roach $this->assertSame('Free white females 60-70 years', $columns[22]->title()); 1793e615db9SGreg Roach $this->assertSame('Free white females 70-80 years', $columns[23]->title()); 1803e615db9SGreg Roach $this->assertSame('Free white females 80-90 years', $columns[24]->title()); 1813e615db9SGreg Roach $this->assertSame('Free white females 90-100 years', $columns[25]->title()); 1823e615db9SGreg Roach $this->assertSame('Free white females 100+ years', $columns[26]->title()); 1833e615db9SGreg Roach $this->assertSame('Slave males 0-10 years', $columns[27]->title()); 1843e615db9SGreg Roach $this->assertSame('Slave males 10-24 years', $columns[28]->title()); 1853e615db9SGreg Roach $this->assertSame('Slave males 24-36 years', $columns[29]->title()); 1863e615db9SGreg Roach $this->assertSame('Slave males 36-55 years', $columns[30]->title()); 1873e615db9SGreg Roach $this->assertSame('Slave males 55-100 years', $columns[31]->title()); 1883e615db9SGreg Roach $this->assertSame('Slave males 100+ years', $columns[32]->title()); 1893e615db9SGreg Roach $this->assertSame('Slave females 0-10 years', $columns[33]->title()); 1903e615db9SGreg Roach $this->assertSame('Slave females 10-24 years', $columns[34]->title()); 1913e615db9SGreg Roach $this->assertSame('Slave females 24-36 years', $columns[35]->title()); 1923e615db9SGreg Roach $this->assertSame('Slave females 36-55 years', $columns[36]->title()); 1933e615db9SGreg Roach $this->assertSame('Slave females 55-100 years', $columns[37]->title()); 1943e615db9SGreg Roach $this->assertSame('Slave females 100+ years', $columns[38]->title()); 1953e615db9SGreg Roach $this->assertSame('Free colored males 0-10 years', $columns[39]->title()); 1963e615db9SGreg Roach $this->assertSame('Free colored males 10-24 years', $columns[40]->title()); 1973e615db9SGreg Roach $this->assertSame('Free colored males 24-36 years', $columns[41]->title()); 1983e615db9SGreg Roach $this->assertSame('Free colored males 36-55 years', $columns[42]->title()); 1993e615db9SGreg Roach $this->assertSame('Free colored males 55-100 years', $columns[43]->title()); 2003e615db9SGreg Roach $this->assertSame('Free colored males 100+ years', $columns[44]->title()); 2013e615db9SGreg Roach $this->assertSame('Free colored females 0-10 years', $columns[45]->title()); 2023e615db9SGreg Roach $this->assertSame('Free colored females 10-24 years', $columns[46]->title()); 2033e615db9SGreg Roach $this->assertSame('Free colored females 24-36 years', $columns[47]->title()); 2043e615db9SGreg Roach $this->assertSame('Free colored females 36-55 years', $columns[48]->title()); 2053e615db9SGreg Roach $this->assertSame('Free colored females 55-100 years', $columns[49]->title()); 2063e615db9SGreg Roach $this->assertSame('Free colored females 100+ years', $columns[50]->title()); 2073e615db9SGreg Roach } 2083e615db9SGreg Roach} 209