diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-10-29 13:27:40 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-10-29 17:34:39 +0000 |
| commit | f3fa6d90bdc7225bdbe6300f0588c5935d1cc217 (patch) | |
| tree | 7f2428fee6b7c0d0e765d3f0815ac04d0881ddf7 /tests/app/Census | |
| parent | 0b18a98d2ceaeebc288d72a27a147055f7d6115d (diff) | |
| download | webtrees-f3fa6d90bdc7225bdbe6300f0588c5935d1cc217.tar.gz webtrees-f3fa6d90bdc7225bdbe6300f0588c5935d1cc217.tar.bz2 webtrees-f3fa6d90bdc7225bdbe6300f0588c5935d1cc217.zip | |
US Census
Diffstat (limited to 'tests/app/Census')
18 files changed, 706 insertions, 97 deletions
diff --git a/tests/app/Census/CensusColumnBirthDateTest.php b/tests/app/Census/CensusColumnBirthDateTest.php index 7b58581241..15392ee914 100644 --- a/tests/app/Census/CensusColumnBirthDateTest.php +++ b/tests/app/Census/CensusColumnBirthDateTest.php @@ -37,8 +37,11 @@ class CensusColumnBirthDateTest extends \PHPUnit_Framework_TestCase { * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testGenerateColumn() { + $cal_date = Mockery::mock(Date\CalendarDate::class); + $cal_date->shouldReceive('format')->andReturn('1 1 1800'); + $date = Mockery::mock(Date::class); - $date->shouldReceive('display')->andReturn('1 January 1800'); + $date->shouldReceive('minimumDate')->andReturn($cal_date); $individual = Mockery::mock(Individual::class); $individual->shouldReceive('getEstimatedBirthDate')->andReturn($date); @@ -48,6 +51,6 @@ class CensusColumnBirthDateTest extends \PHPUnit_Framework_TestCase { $column = new CensusColumnBirthDate($census, '', ''); - $this->assertSame('1 January 1800', $column->generate($individual)); + $this->assertSame('1 1 1800', $column->generate($individual)); } } diff --git a/tests/app/Census/CensusColumnBirthMonthTest.php b/tests/app/Census/CensusColumnBirthMonthTest.php new file mode 100644 index 0000000000..75aed25829 --- /dev/null +++ b/tests/app/Census/CensusColumnBirthMonthTest.php @@ -0,0 +1,56 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2015 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnAge + */ +class CensusColumnBirthMonthTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnBirthMonth + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testGenerateColumn() { + $cal_date = Mockery::mock(Date\CalendarDate::class); + $cal_date->shouldReceive('format')->andReturn('Jan'); + + $date = Mockery::mock(Date::class); + $date->shouldReceive('minimumDate')->andReturn($cal_date); + + $individual = Mockery::mock(Individual::class); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn($date); + + $census = Mockery::mock(CensusInterface::class); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1832'); + + $column = new CensusColumnBirthMonth($census, '', ''); + + $this->assertSame('Jan', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusColumnBirthYearTest.php b/tests/app/Census/CensusColumnBirthYearTest.php new file mode 100644 index 0000000000..0847f764c4 --- /dev/null +++ b/tests/app/Census/CensusColumnBirthYearTest.php @@ -0,0 +1,56 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2015 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnAge + */ +class CensusColumnBirthYearTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnBirthYear + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testGenerateColumn() { + $cal_date = Mockery::mock(Date\CalendarDate::class); + $cal_date->shouldReceive('format')->andReturn('1800'); + + $date = Mockery::mock(Date::class); + $date->shouldReceive('minimumDate')->andReturn($cal_date); + + $individual = Mockery::mock(Individual::class); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn($date); + + $census = Mockery::mock(CensusInterface::class); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1832'); + + $column = new CensusColumnBirthYear($census, '', ''); + + $this->assertSame('1800', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusColumnGivenNameInitialTest.php b/tests/app/Census/CensusColumnGivenNameInitialTest.php new file mode 100644 index 0000000000..5bc14de2dc --- /dev/null +++ b/tests/app/Census/CensusColumnGivenNameInitialTest.php @@ -0,0 +1,79 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2015 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnGivenNameInitial + */ +class CensusColumnGivenNameInitialTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnGivenNameInitial + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testOneGivenName() { + $individual = Mockery::mock(Individual::class); + $individual->shouldReceive('getAllNames')->andReturn([['givn' => 'Joe']]); + + $census = Mockery::mock(CensusInterface::class); + + $column = new CensusColumnGivenNameInitial($census, '', ''); + + $this->assertSame('Joe', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnGivenNameInitial + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testMultipleGivenNames() { + $individual = Mockery::mock(Individual::class); + $individual->shouldReceive('getAllNames')->andReturn([['givn' => 'Joe Fred']]); + + $census = Mockery::mock(CensusInterface::class); + + $column = new CensusColumnGivenNameInitial($census, '', ''); + + $this->assertSame('Joe F', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnGivenNameInitial + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testNoName() { + $individual = Mockery::mock(Individual::class); + $individual->shouldReceive('getAllNames')->andReturn([]); + + $census = Mockery::mock(CensusInterface::class); + + $column = new CensusColumnGivenNameInitial($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusColumnSurnameGivenNameInitialTest.php b/tests/app/Census/CensusColumnSurnameGivenNameInitialTest.php new file mode 100644 index 0000000000..ea6c86bc60 --- /dev/null +++ b/tests/app/Census/CensusColumnSurnameGivenNameInitialTest.php @@ -0,0 +1,79 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2015 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnSurnameGivenNameInitial + */ +class CensusColumnSurnameGivenNameInitialTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnSurnameGivenNameInitial + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testOneGivenName() { + $individual = Mockery::mock(Individual::class); + $individual->shouldReceive('getAllNames')->andReturn([['givn' => 'Joe', 'surn' => 'Sixpack']]); + + $census = Mockery::mock(CensusInterface::class); + + $column = new CensusColumnSurnameGivenNameInitial($census, '', ''); + + $this->assertSame('Sixpack, Joe', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnSurnameGivenNameInitial + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testMultipleGivenNames() { + $individual = Mockery::mock(Individual::class); + $individual->shouldReceive('getAllNames')->andReturn([['givn' => 'Joe Fred', 'surn' => 'Sixpack']]); + + $census = Mockery::mock(CensusInterface::class); + + $column = new CensusColumnSurnameGivenNameInitial($census, '', ''); + + $this->assertSame('Sixpack, Joe F', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnSurnameGivenNameInitial + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testNoName() { + $individual = Mockery::mock(Individual::class); + $individual->shouldReceive('getAllNames')->andReturn([]); + + $census = Mockery::mock(CensusInterface::class); + + $column = new CensusColumnSurnameGivenNameInitial($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusOfScotland1861Test.php b/tests/app/Census/CensusOfScotland1861Test.php index 6e72a4f4b4..bf20c6bcbd 100644 --- a/tests/app/Census/CensusOfScotland1861Test.php +++ b/tests/app/Census/CensusOfScotland1861Test.php @@ -62,7 +62,7 @@ class CensusOfScotland1861Test extends \PHPUnit_Framework_TestCase { $this->assertSame('Occupation', $columns[5]->abbreviation()); $this->assertSame('Birthplace', $columns[6]->abbreviation()); $this->assertSame('Infirm', $columns[7]->abbreviation()); - $this->assertSame('Sch', $columns[8]->abbreviation()); + $this->assertSame('School', $columns[8]->abbreviation()); $this->assertSame('Name and surname', $columns[0]->title()); $this->assertSame('Relation to head of household', $columns[1]->title()); diff --git a/tests/app/Census/CensusOfScotland1871Test.php b/tests/app/Census/CensusOfScotland1871Test.php index bd6a551707..f46e67dd75 100644 --- a/tests/app/Census/CensusOfScotland1871Test.php +++ b/tests/app/Census/CensusOfScotland1871Test.php @@ -62,7 +62,7 @@ class CensusOfScotland1871Test extends \PHPUnit_Framework_TestCase { $this->assertSame('Occupation', $columns[5]->abbreviation()); $this->assertSame('Birthplace', $columns[6]->abbreviation()); $this->assertSame('Infirm', $columns[7]->abbreviation()); - $this->assertSame('Sch', $columns[8]->abbreviation()); + $this->assertSame('School', $columns[8]->abbreviation()); $this->assertSame('Name and surname', $columns[0]->title()); $this->assertSame('Relation to head of household', $columns[1]->title()); diff --git a/tests/app/Census/CensusOfUnitedStates1850Test.php b/tests/app/Census/CensusOfUnitedStates1850Test.php index 364f13dba6..10e1a8b1f3 100644 --- a/tests/app/Census/CensusOfUnitedStates1850Test.php +++ b/tests/app/Census/CensusOfUnitedStates1850Test.php @@ -64,7 +64,7 @@ class CensusOfUnitedStates1850Test extends \PHPUnit_Framework_TestCase { $this->assertSame('RE', $columns[5]->abbreviation()); $this->assertSame('Birthplace', $columns[6]->abbreviation()); $this->assertSame('Mar', $columns[7]->abbreviation()); - $this->assertSame('Sch', $columns[8]->abbreviation()); + $this->assertSame('School', $columns[8]->abbreviation()); $this->assertSame('R+W', $columns[9]->abbreviation()); $this->assertSame('Infirm', $columns[10]->abbreviation()); diff --git a/tests/app/Census/CensusOfUnitedStates1860Test.php b/tests/app/Census/CensusOfUnitedStates1860Test.php index b8a0108042..0782ce3799 100644 --- a/tests/app/Census/CensusOfUnitedStates1860Test.php +++ b/tests/app/Census/CensusOfUnitedStates1860Test.php @@ -66,7 +66,7 @@ class CensusOfUnitedStates1860Test extends \PHPUnit_Framework_TestCase { $this->assertSame('PE', $columns[6]->abbreviation()); $this->assertSame('Birthplace', $columns[7]->abbreviation()); $this->assertSame('Mar', $columns[8]->abbreviation()); - $this->assertSame('Sch', $columns[9]->abbreviation()); + $this->assertSame('School', $columns[9]->abbreviation()); $this->assertSame('R+W', $columns[10]->abbreviation()); $this->assertSame('Infirm', $columns[11]->abbreviation()); diff --git a/tests/app/Census/CensusOfUnitedStates1870Test.php b/tests/app/Census/CensusOfUnitedStates1870Test.php index e6e64f7aba..6d5ff2c556 100644 --- a/tests/app/Census/CensusOfUnitedStates1870Test.php +++ b/tests/app/Census/CensusOfUnitedStates1870Test.php @@ -75,9 +75,9 @@ class CensusOfUnitedStates1870Test extends \PHPUnit_Framework_TestCase { $this->assertSame('MFB', $columns[9]->abbreviation()); $this->assertSame('Born', $columns[10]->abbreviation()); $this->assertSame('Mar', $columns[11]->abbreviation()); - $this->assertSame('Sch', $columns[12]->abbreviation()); - $this->assertSame('R', $columns[13]->abbreviation()); - $this->assertSame('W', $columns[14]->abbreviation()); + $this->assertSame('School', $columns[12]->abbreviation()); + $this->assertSame('Read', $columns[13]->abbreviation()); + $this->assertSame('Write', $columns[14]->abbreviation()); $this->assertSame('Infirm', $columns[15]->abbreviation()); $this->assertSame('Cit', $columns[16]->abbreviation()); $this->assertSame('Dis', $columns[17]->abbreviation()); diff --git a/tests/app/Census/CensusOfUnitedStates1880Test.php b/tests/app/Census/CensusOfUnitedStates1880Test.php index aa8dd0294a..bcec0de33c 100644 --- a/tests/app/Census/CensusOfUnitedStates1880Test.php +++ b/tests/app/Census/CensusOfUnitedStates1880Test.php @@ -73,24 +73,24 @@ class CensusOfUnitedStates1880Test extends \PHPUnit_Framework_TestCase { $this->assertSame('Sex', $columns[2]->abbreviation()); $this->assertSame('Mon', $columns[3]->abbreviation()); $this->assertSame('Relation', $columns[4]->abbreviation()); - $this->assertSame('S', $columns[5]->abbreviation()); - $this->assertSame('M', $columns[6]->abbreviation()); - $this->assertSame('W', $columns[7]->abbreviation()); + $this->assertSame('Single', $columns[5]->abbreviation()); + $this->assertSame('Married', $columns[6]->abbreviation()); + $this->assertSame('Write', $columns[7]->abbreviation()); $this->assertSame('MY', $columns[8]->abbreviation()); $this->assertSame('Occupation', $columns[9]->abbreviation()); $this->assertSame('Un', $columns[10]->abbreviation()); $this->assertSame('Sick', $columns[11]->abbreviation()); - $this->assertSame('Bl', $columns[12]->abbreviation()); + $this->assertSame('Blind', $columns[12]->abbreviation()); $this->assertSame('DD', $columns[13]->abbreviation()); - $this->assertSame('Id', $columns[14]->abbreviation()); - $this->assertSame('In', $columns[15]->abbreviation()); - $this->assertSame('Dis', $columns[16]->abbreviation()); - $this->assertSame('Sch', $columns[17]->abbreviation()); - $this->assertSame('R', $columns[18]->abbreviation()); - $this->assertSame('W', $columns[19]->abbreviation()); - $this->assertSame('BP', $columns[20]->abbreviation()); - $this->assertSame('FBP', $columns[21]->abbreviation()); - $this->assertSame('MBP', $columns[22]->abbreviation()); + $this->assertSame('Idiotic', $columns[14]->abbreviation()); + $this->assertSame('Insane', $columns[15]->abbreviation()); + $this->assertSame('Disabled', $columns[16]->abbreviation()); + $this->assertSame('School', $columns[17]->abbreviation()); + $this->assertSame('Read', $columns[18]->abbreviation()); + $this->assertSame('Write', $columns[19]->abbreviation()); + $this->assertSame('Birthplace', $columns[20]->abbreviation()); + $this->assertSame('Father’s birthplace', $columns[21]->abbreviation()); + $this->assertSame('Mother’s birthplace', $columns[22]->abbreviation()); $this->assertSame('Name', $columns[0]->title()); $this->assertSame('Age', $columns[1]->title()); diff --git a/tests/app/Census/CensusOfUnitedStates1890Test.php b/tests/app/Census/CensusOfUnitedStates1890Test.php index 03c72a05f4..dd0a3d859c 100644 --- a/tests/app/Census/CensusOfUnitedStates1890Test.php +++ b/tests/app/Census/CensusOfUnitedStates1890Test.php @@ -43,11 +43,80 @@ class CensusOfUnitedStates1890Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfUnitedStates1890; $columns = $census->columns(); - $this->assertCount(1, $columns); - $this->assertInstanceOf(CensusColumnNull::class, $columns[0]); + $this->assertCount(24, $columns); + $this->assertInstanceOf(CensusColumnGivenNameInitial::class, $columns[0]); + $this->assertInstanceOf(CensusColumnSurname::class, $columns[1]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[2]); + $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[3]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[4]); + $this->assertInstanceOf(CensusColumnSexMF::class, $columns[5]); + $this->assertInstanceOf(CensusColumnAge::class, $columns[6]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[7]); + $this->assertInstanceOf(CensusColumnMonthIfMarriedWithinYear::class, $columns[8]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[9]); + $this->assertInstanceOf(CensusColumnBirthPlaceSimple::class, $columns[10]); + $this->assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[11]); + $this->assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[12]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[13]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[14]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[15]); + $this->assertInstanceOf(CensusColumnOccupation::class, $columns[16]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[17]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[18]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[19]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[20]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[21]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[22]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[23]); - $this->assertSame('XXXX', $columns[0]->abbreviation()); + $this->assertSame('Name', $columns[0]->abbreviation()); + $this->assertSame('Surname', $columns[1]->abbreviation()); + $this->assertSame('CW', $columns[2]->abbreviation()); + $this->assertSame('Relation', $columns[3]->abbreviation()); + $this->assertSame('Race', $columns[4]->abbreviation()); + $this->assertSame('Sex', $columns[5]->abbreviation()); + $this->assertSame('Age', $columns[6]->abbreviation()); + $this->assertSame('Condition', $columns[7]->abbreviation()); + $this->assertSame('Mar', $columns[8]->abbreviation()); + $this->assertSame('Children', $columns[9]->abbreviation()); + $this->assertSame('Birthplace', $columns[10]->abbreviation()); + $this->assertSame('Father’s birthplace', $columns[11]->abbreviation()); + $this->assertSame('Mother’s birthplace', $columns[12]->abbreviation()); + $this->assertSame('US', $columns[13]->abbreviation()); + $this->assertSame('Nat', $columns[14]->abbreviation()); + $this->assertSame('Papers', $columns[15]->abbreviation()); + $this->assertSame('Occupation', $columns[16]->abbreviation()); + $this->assertSame('Unemployed', $columns[17]->abbreviation()); + $this->assertSame('Read', $columns[18]->abbreviation()); + $this->assertSame('Write', $columns[19]->abbreviation()); + $this->assertSame('English', $columns[20]->abbreviation()); + $this->assertSame('Disease', $columns[21]->abbreviation()); + $this->assertSame('Infirm', $columns[22]->abbreviation()); + $this->assertSame('Prisoner', $columns[23]->abbreviation()); - $this->assertSame('XXXX', $columns[0]->title()); + $this->assertSame('Christian name in full, and initial of middle name', $columns[0]->title()); + $this->assertSame('Surname', $columns[1]->title()); + $this->assertSame('Whether a soldier, sailor or marine during the civil war (U.S. or Conf.), or widow of such person', $columns[2]->title()); + $this->assertSame('Relation to head of family', $columns[3]->title()); + $this->assertSame('Whether white, black, mulatto, quadroon, octoroon, Chinese, Japanese, or Indian', $columns[4]->title()); + $this->assertSame('Sex', $columns[5]->title()); + $this->assertSame('Age at nearest birthday. If under one year, give age in months', $columns[6]->title()); + $this->assertSame('Whether single, married, widowed, or divorced', $columns[7]->title()); + $this->assertSame('Whether married duirng the census year (June 1, 1889, to May 31, 1890)', $columns[8]->title()); + $this->assertSame('Mother of how many children, and number of these children living', $columns[9]->title()); + $this->assertSame('Place of birth', $columns[10]->title()); + $this->assertSame('Place of birth of father', $columns[11]->title()); + $this->assertSame('Place of birth of mother', $columns[12]->title()); + $this->assertSame('Number of years in the United States', $columns[13]->title()); + $this->assertSame('Whether naturalized', $columns[14]->title()); + $this->assertSame('Whether naturalization papers have been taken out', $columns[15]->title()); + $this->assertSame('Profession, trade, occupation', $columns[16]->title()); + $this->assertSame('Months unemployed during the census year (June 1, 1889, to May 31, 1890)', $columns[17]->title()); + $this->assertSame('Able to read', $columns[18]->title()); + $this->assertSame('Able to write', $columns[19]->title()); + $this->assertSame('Able to speak English. If not the language or dialect spoken', $columns[20]->title()); + $this->assertSame('Whether suffering from acute or chronic disease, with name of disease and length of time afflicted', $columns[21]->title()); + $this->assertSame('Whether defective in mind, sight, hearing, or speech, or whether crippled, maimed, or deformed, with name of defect', $columns[22]->title()); + $this->assertSame('Whether a prisoner, convict, homeless child, or pauper', $columns[23]->title()); } } diff --git a/tests/app/Census/CensusOfUnitedStates1900Test.php b/tests/app/Census/CensusOfUnitedStates1900Test.php index 209b276ceb..f76b127c98 100644 --- a/tests/app/Census/CensusOfUnitedStates1900Test.php +++ b/tests/app/Census/CensusOfUnitedStates1900Test.php @@ -43,11 +43,86 @@ class CensusOfUnitedStates1900Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfUnitedStates1900; $columns = $census->columns(); - $this->assertCount(1, $columns); - $this->assertInstanceOf(CensusColumnNull::class, $columns[0]); + $this->assertCount(26, $columns); + $this->assertInstanceOf(CensusColumnFullName::class, $columns[0]); + $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[1]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[2]); + $this->assertInstanceOf(CensusColumnSexMF::class, $columns[3]); + $this->assertInstanceOf(CensusColumnBirthMonth::class, $columns[4]); + $this->assertInstanceOf(CensusColumnBirthYear::class, $columns[5]); + $this->assertInstanceOf(CensusColumnAge::class, $columns[6]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[7]); + $this->assertInstanceOf(CensusColumnYearsMarried::class, $columns[8]); + $this->assertInstanceOf(CensusColumnChildrenBornAlive::class, $columns[9]); + $this->assertInstanceOf(CensusColumnChildrenLiving::class, $columns[10]); + $this->assertInstanceOf(CensusColumnBirthPlaceSimple::class, $columns[11]); + $this->assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[12]); + $this->assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[13]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[14]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[15]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[16]); + $this->assertInstanceOf(CensusColumnOccupation::class, $columns[17]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[18]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[19]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[20]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[21]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[22]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[23]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[24]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[25]); - $this->assertSame('XXXX', $columns[0]->abbreviation()); + $this->assertSame('Name', $columns[0]->abbreviation()); + $this->assertSame('Relation', $columns[1]->abbreviation()); + $this->assertSame('Race', $columns[2]->abbreviation()); + $this->assertSame('Sex', $columns[3]->abbreviation()); + $this->assertSame('Month', $columns[4]->abbreviation()); + $this->assertSame('Year', $columns[5]->abbreviation()); + $this->assertSame('Age', $columns[6]->abbreviation()); + $this->assertSame('Condition', $columns[7]->abbreviation()); + $this->assertSame('Marr', $columns[8]->abbreviation()); + $this->assertSame('Chil', $columns[9]->abbreviation()); + $this->assertSame('Chil', $columns[10]->abbreviation()); + $this->assertSame('Birthplace', $columns[11]->abbreviation()); + $this->assertSame('Father’s birthplace', $columns[12]->abbreviation()); + $this->assertSame('Mother’s birthplace', $columns[13]->abbreviation()); + $this->assertSame('Imm', $columns[14]->abbreviation()); + $this->assertSame('US', $columns[15]->abbreviation()); + $this->assertSame('Nat', $columns[16]->abbreviation()); + $this->assertSame('Occupation', $columns[17]->abbreviation()); + $this->assertSame('Unemployed', $columns[18]->abbreviation()); + $this->assertSame('School', $columns[19]->abbreviation()); + $this->assertSame('Read', $columns[20]->abbreviation()); + $this->assertSame('Write', $columns[21]->abbreviation()); + $this->assertSame('English', $columns[22]->abbreviation()); + $this->assertSame('Home', $columns[23]->abbreviation()); + $this->assertSame('Mort', $columns[24]->abbreviation()); + $this->assertSame('Farm', $columns[25]->abbreviation()); - $this->assertSame('XXXX', $columns[0]->title()); + $this->assertSame('Name', $columns[0]->title()); + $this->assertSame('Relationship of each person to the head of the family', $columns[1]->title()); + $this->assertSame('Color or race', $columns[2]->title()); + $this->assertSame('Sex', $columns[3]->title()); + $this->assertSame('Month of birth', $columns[4]->title()); + $this->assertSame('Year of birth', $columns[5]->title()); + $this->assertSame('Age at last birthday', $columns[6]->title()); + $this->assertSame('Whether single, married, widowed, or divorced', $columns[7]->title()); + $this->assertSame('Number of years married', $columns[8]->title()); + $this->assertSame('Mother of how many children', $columns[9]->title()); + $this->assertSame('Number of these children living', $columns[10]->title()); + $this->assertSame('Place of birth of this person', $columns[11]->title()); + $this->assertSame('Place of birth of father of this person', $columns[12]->title()); + $this->assertSame('Place of birth of mother of this person', $columns[13]->title()); + $this->assertSame('Year of immigration to the United States', $columns[14]->title()); + $this->assertSame('Number of years in the United States', $columns[15]->title()); + $this->assertSame('Naturalization', $columns[16]->title()); + $this->assertSame('Occupation, trade of profession', $columns[17]->title()); + $this->assertSame('Months not unemployed', $columns[18]->title()); + $this->assertSame('Attended school (in months)', $columns[19]->title()); + $this->assertSame('Can read', $columns[20]->title()); + $this->assertSame('Can write', $columns[21]->title()); + $this->assertSame('Can speak English', $columns[22]->title()); + $this->assertSame('Owned or rented', $columns[23]->title()); + $this->assertSame('Owned free or mortgaged', $columns[24]->title()); + $this->assertSame('Farm or house', $columns[25]->title()); } } diff --git a/tests/app/Census/CensusOfUnitedStates1910Test.php b/tests/app/Census/CensusOfUnitedStates1910Test.php index 1b2cfeb04c..fca208c56f 100644 --- a/tests/app/Census/CensusOfUnitedStates1910Test.php +++ b/tests/app/Census/CensusOfUnitedStates1910Test.php @@ -43,11 +43,95 @@ class CensusOfUnitedStates1910Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfUnitedStates1910; $columns = $census->columns(); - $this->assertCount(1, $columns); - $this->assertInstanceOf(CensusColumnNull::class, $columns[0]); + $this->assertCount(29, $columns); + $this->assertInstanceOf(CensusColumnSurnameGivenNameInitial::class, $columns[0]); + $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[1]); + $this->assertInstanceOf(CensusColumnSexMF::class, $columns[2]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[3]); + $this->assertInstanceOf(CensusColumnAge::class, $columns[4]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[5]); + $this->assertInstanceOf(CensusColumnYearsMarried::class, $columns[6]); + $this->assertInstanceOf(CensusColumnChildrenBornAlive::class, $columns[7]); + $this->assertInstanceOf(CensusColumnChildrenLiving::class, $columns[8]); + $this->assertInstanceOf(CensusColumnBirthPlaceSimple::class, $columns[9]); + $this->assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[10]); + $this->assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[11]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[12]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[13]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[14]); + $this->assertInstanceOf(CensusColumnOccupation::class, $columns[15]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[16]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[17]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[18]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[19]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[20]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[21]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[22]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[23]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[24]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[25]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[26]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[27]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[28]); - $this->assertSame('XXXX', $columns[0]->abbreviation()); + $this->assertSame('Name', $columns[0]->abbreviation()); + $this->assertSame('Relation', $columns[1]->abbreviation()); + $this->assertSame('Sex', $columns[2]->abbreviation()); + $this->assertSame('Race', $columns[3]->abbreviation()); + $this->assertSame('Age', $columns[4]->abbreviation()); + $this->assertSame('Condition', $columns[5]->abbreviation()); + $this->assertSame('Marr', $columns[6]->abbreviation()); + $this->assertSame('Chil', $columns[7]->abbreviation()); + $this->assertSame('Chil', $columns[8]->abbreviation()); + $this->assertSame('Birthplace', $columns[9]->abbreviation()); + $this->assertSame('Father’s birthplace', $columns[10]->abbreviation()); + $this->assertSame('Mother’s birthplace', $columns[11]->abbreviation()); + $this->assertSame('Imm', $columns[12]->abbreviation()); + $this->assertSame('Nat', $columns[13]->abbreviation()); + $this->assertSame('Language', $columns[14]->abbreviation()); + $this->assertSame('Occupation', $columns[15]->abbreviation()); + $this->assertSame('Ind', $columns[16]->abbreviation()); + $this->assertSame('Emp', $columns[17]->abbreviation()); + $this->assertSame('Unemployed', $columns[18]->abbreviation()); + $this->assertSame('Unemployed', $columns[19]->abbreviation()); + $this->assertSame('Read', $columns[20]->abbreviation()); + $this->assertSame('Write', $columns[21]->abbreviation()); + $this->assertSame('School', $columns[22]->abbreviation()); + $this->assertSame('Home', $columns[23]->abbreviation()); + $this->assertSame('Mort', $columns[24]->abbreviation()); + $this->assertSame('Farm', $columns[25]->abbreviation()); + $this->assertSame('CW', $columns[26]->abbreviation()); + $this->assertSame('Blind', $columns[27]->abbreviation()); + $this->assertSame('Deaf', $columns[28]->abbreviation()); - $this->assertSame('XXXX', $columns[0]->title()); + $this->assertSame('Name', $columns[0]->title()); + $this->assertSame('Relationship of each person to the head of the family', $columns[1]->title()); + $this->assertSame('Sex', $columns[2]->title()); + $this->assertSame('Color or race', $columns[3]->title()); + $this->assertSame('Age at last birthday', $columns[4]->title()); + $this->assertSame('Whether single, married, widowed, or divorced', $columns[5]->title()); + $this->assertSame('Number of years of present marriage', $columns[6]->title()); + $this->assertSame('Mother of how many children', $columns[7]->title()); + $this->assertSame('Number of these children living', $columns[8]->title()); + $this->assertSame('Place of birth of this person', $columns[9]->title()); + $this->assertSame('Place of birth of father of this person', $columns[10]->title()); + $this->assertSame('Place of birth of mother of this person', $columns[11]->title()); + $this->assertSame('Year of immigration to the United States', $columns[12]->title()); + $this->assertSame('Whether naturalized or alien', $columns[13]->title()); + $this->assertSame('Whether able to speak English, of if not, give language spoken', $columns[14]->title()); + $this->assertSame('Trade or profession of, or particular kind of work done by this person', $columns[15]->title()); + $this->assertSame('General nature of industry', $columns[16]->title()); + $this->assertSame('Whether an employer, employee, or work on own account', $columns[17]->title()); + $this->assertSame('Whether out of work on April 15, 1910', $columns[18]->title()); + $this->assertSame('Number of weeks out of work in 1909', $columns[19]->title()); + $this->assertSame('Whether able to read', $columns[20]->title()); + $this->assertSame('Whether able to write', $columns[21]->title()); + $this->assertSame('Attended school since September 1, 1909', $columns[22]->title()); + $this->assertSame('Owned or rented', $columns[23]->title()); + $this->assertSame('Owned free or mortgaged', $columns[24]->title()); + $this->assertSame('Farm or house', $columns[25]->title()); + $this->assertSame('Whether a survivor of the Union or Confederate Army or Navy', $columns[26]->title()); + $this->assertSame('Whether blind (both eyes)', $columns[27]->title()); + $this->assertSame('Whether deaf and dumb', $columns[28]->title()); } } diff --git a/tests/app/Census/CensusOfUnitedStates1920Test.php b/tests/app/Census/CensusOfUnitedStates1920Test.php index c7aceba830..669dc586b0 100644 --- a/tests/app/Census/CensusOfUnitedStates1920Test.php +++ b/tests/app/Census/CensusOfUnitedStates1920Test.php @@ -43,11 +43,80 @@ class CensusOfUnitedStates1920Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfUnitedStates1920; $columns = $census->columns(); - $this->assertCount(1, $columns); - $this->assertInstanceOf(CensusColumnNull::class, $columns[0]); + $this->assertCount(24, $columns); + $this->assertInstanceOf(CensusColumnSurnameGivenNameInitial::class, $columns[0]); + $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[1]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[2]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[3]); + $this->assertInstanceOf(CensusColumnSexMF::class, $columns[4]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[5]); + $this->assertInstanceOf(CensusColumnAge::class, $columns[6]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[7]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[8]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[9]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[10]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[11]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[12]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[13]); + $this->assertInstanceOf(CensusColumnBirthPlaceSimple::class, $columns[14]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[15]); + $this->assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[16]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[17]); + $this->assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[18]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[19]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[20]); + $this->assertInstanceOf(CensusColumnOccupation::class, $columns[21]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[22]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[23]); - $this->assertSame('XXXX', $columns[0]->abbreviation()); + $this->assertSame('Name', $columns[0]->abbreviation()); + $this->assertSame('Relation', $columns[1]->abbreviation()); + $this->assertSame('Home', $columns[2]->abbreviation()); + $this->assertSame('Mort', $columns[3]->abbreviation()); + $this->assertSame('Sex', $columns[4]->abbreviation()); + $this->assertSame('Race', $columns[5]->abbreviation()); + $this->assertSame('Age', $columns[6]->abbreviation()); + $this->assertSame('Condition', $columns[7]->abbreviation()); + $this->assertSame('Imm', $columns[8]->abbreviation()); + $this->assertSame('Nat', $columns[9]->abbreviation()); + $this->assertSame('NatY', $columns[10]->abbreviation()); + $this->assertSame('School', $columns[11]->abbreviation()); + $this->assertSame('Read', $columns[12]->abbreviation()); + $this->assertSame('Write', $columns[13]->abbreviation()); + $this->assertSame('Birthplace', $columns[14]->abbreviation()); + $this->assertSame('Language', $columns[15]->abbreviation()); + $this->assertSame('Father’s birthplace', $columns[16]->abbreviation()); + $this->assertSame('Father language', $columns[17]->abbreviation()); + $this->assertSame('Mother’s birthplace', $columns[18]->abbreviation()); + $this->assertSame('Mother language', $columns[19]->abbreviation()); + $this->assertSame('English', $columns[20]->abbreviation()); + $this->assertSame('Occupation', $columns[21]->abbreviation()); + $this->assertSame('Ind', $columns[22]->abbreviation()); + $this->assertSame('Emp', $columns[23]->abbreviation()); - $this->assertSame('XXXX', $columns[0]->title()); + $this->assertSame('Name', $columns[0]->title()); + $this->assertSame('Relationship of each person to the head of the family', $columns[1]->title()); + $this->assertSame('Owned or rented', $columns[2]->title()); + $this->assertSame('If owned, free or mortgaged', $columns[3]->title()); + $this->assertSame('Sex', $columns[4]->title()); + $this->assertSame('Color or race', $columns[5]->title()); + $this->assertSame('Age at last birthday', $columns[6]->title()); + $this->assertSame('Whether single, married, widowed, or divorced', $columns[7]->title()); + $this->assertSame('Year of immigration to the United States', $columns[8]->title()); + $this->assertSame('Naturalized or alien', $columns[9]->title()); + $this->assertSame('If naturalized, year of naturalization', $columns[10]->title()); + $this->assertSame('Attended school since Sept. 1, 1919', $columns[11]->title()); + $this->assertSame('Whether able to read', $columns[12]->title()); + $this->assertSame('Whether able to write', $columns[13]->title()); + $this->assertSame('Place of birth', $columns[14]->title()); + $this->assertSame('Mother tongue', $columns[15]->title()); + $this->assertSame('Place of birth of father', $columns[16]->title()); + $this->assertSame('Mother tongue of father', $columns[17]->title()); + $this->assertSame('Place of birth of mother', $columns[18]->title()); + $this->assertSame('Mother tongue of mother', $columns[19]->title()); + $this->assertSame('Whether able to speak English', $columns[20]->title()); + $this->assertSame('Trade, profession, or particular kind of work done', $columns[21]->title()); + $this->assertSame('Industry, business of establishment in which at work', $columns[22]->title()); + $this->assertSame('Employer, salary or wage worker, or work on own account', $columns[23]->title()); } } diff --git a/tests/app/Census/CensusOfUnitedStates1930Test.php b/tests/app/Census/CensusOfUnitedStates1930Test.php index c302fe9d3a..f2511cf2f3 100644 --- a/tests/app/Census/CensusOfUnitedStates1930Test.php +++ b/tests/app/Census/CensusOfUnitedStates1930Test.php @@ -43,11 +43,104 @@ class CensusOfUnitedStates1930Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfUnitedStates1930; $columns = $census->columns(); - $this->assertCount(1, $columns); - $this->assertInstanceOf(CensusColumnNull::class, $columns[0]); + $this->assertCount(32, $columns); + $this->assertInstanceOf(CensusColumnSurnameGivenNameInitial::class, $columns[0]); + $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[1]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[2]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[3]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[4]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[5]); + $this->assertInstanceOf(CensusColumnSexMF::class, $columns[6]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[7]); + $this->assertInstanceOf(CensusColumnAge::class, $columns[8]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[9]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[10]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[11]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[12]); + $this->assertInstanceOf(CensusColumnBirthPlaceSimple::class, $columns[13]); + $this->assertInstanceOf(CensusColumnFatherBirthPlaceSimple::class, $columns[14]); + $this->assertInstanceOf(CensusColumnMotherBirthPlaceSimple::class, $columns[15]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[16]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[17]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[18]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[19]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[20]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[21]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[22]); + $this->assertInstanceOf(CensusColumnOccupation::class, $columns[23]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[24]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[25]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[26]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[27]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[28]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[29]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[30]); + $this->assertInstanceOf(CensusColumnNull::class, $columns[31]); - $this->assertSame('XXXX', $columns[0]->abbreviation()); + $this->assertSame('Name', $columns[0]->abbreviation()); + $this->assertSame('Relation', $columns[1]->abbreviation()); + $this->assertSame('Home', $columns[2]->abbreviation()); + $this->assertSame('Value/rent', $columns[3]->abbreviation()); + $this->assertSame('Radio', $columns[4]->abbreviation()); + $this->assertSame('Farm', $columns[5]->abbreviation()); + $this->assertSame('Sex', $columns[6]->abbreviation()); + $this->assertSame('Race', $columns[7]->abbreviation()); + $this->assertSame('Age', $columns[8]->abbreviation()); + $this->assertSame('Condition', $columns[9]->abbreviation()); + $this->assertSame('Age married', $columns[10]->abbreviation()); + $this->assertSame('School', $columns[11]->abbreviation()); + $this->assertSame('Read/write', $columns[12]->abbreviation()); + $this->assertSame('Birthplace', $columns[13]->abbreviation()); + $this->assertSame('Father’s birthplace', $columns[14]->abbreviation()); + $this->assertSame('Mother’s birthplace', $columns[15]->abbreviation()); + $this->assertSame('Language', $columns[16]->abbreviation()); + $this->assertSame('?', $columns[17]->abbreviation()); + $this->assertSame('?', $columns[18]->abbreviation()); + $this->assertSame('?', $columns[19]->abbreviation()); + $this->assertSame('Imm', $columns[20]->abbreviation()); + $this->assertSame('Nat', $columns[21]->abbreviation()); + $this->assertSame('English', $columns[22]->abbreviation()); + $this->assertSame('Occupation', $columns[23]->abbreviation()); + $this->assertSame('Industry', $columns[24]->abbreviation()); + $this->assertSame('Code', $columns[25]->abbreviation()); + $this->assertSame('Emp', $columns[26]->abbreviation()); + $this->assertSame('Work', $columns[27]->abbreviation()); + $this->assertSame('Unemp', $columns[28]->abbreviation()); + $this->assertSame('Veteran', $columns[29]->abbreviation()); + $this->assertSame('War', $columns[30]->abbreviation()); + $this->assertSame('?', $columns[31]->abbreviation()); - $this->assertSame('XXXX', $columns[0]->title()); + $this->assertSame('Name', $columns[0]->title()); + $this->assertSame('Relationship of each person to the head of the family', $columns[1]->title()); + $this->assertSame('Home owned or rented', $columns[2]->title()); + $this->assertSame('Value of house, if owned, or monthly rental if rented', $columns[3]->title()); + $this->assertSame('Radio set', $columns[4]->title()); + $this->assertSame('Does this family live on a farm', $columns[5]->title()); + $this->assertSame('Sex', $columns[6]->title()); + $this->assertSame('Color or race', $columns[7]->title()); + $this->assertSame('Age at last birthday', $columns[8]->title()); + $this->assertSame('Whether single, married, widowed, or divorced', $columns[9]->title()); + $this->assertSame('Age at first marriage', $columns[10]->title()); + $this->assertSame('Attended school since Sept. 1, 1929', $columns[11]->title()); + $this->assertSame('Whether able to read and write', $columns[12]->title()); + $this->assertSame('Place of birth', $columns[13]->title()); + $this->assertSame('Place of birth of father', $columns[14]->title()); + $this->assertSame('Place of birth of mother', $columns[15]->title()); + $this->assertSame('Language spoken in home before coming to the United States', $columns[16]->title()); + $this->assertSame('Code', $columns[17]->title()); + $this->assertSame('Code', $columns[18]->title()); + $this->assertSame('Code', $columns[19]->title()); + $this->assertSame('Year of immigration to the United States', $columns[20]->title()); + $this->assertSame('Naturalization', $columns[21]->title()); + $this->assertSame('Whether able to speak English', $columns[22]->title()); + $this->assertSame('Trade, profession, or particular kind of work done', $columns[23]->title()); + $this->assertSame('Industry, business of establishment in which at work', $columns[24]->title()); + $this->assertSame('Industry code', $columns[25]->title()); + $this->assertSame('Class of worker', $columns[26]->title()); + $this->assertSame('Whether normally at work yesterday or the last regular working day', $columns[27]->title()); + $this->assertSame('If not, …', $columns[28]->title()); + $this->assertSame('Whether a veteran of U.S. military or …', $columns[29]->title()); + $this->assertSame('What war or …', $columns[30]->title()); + $this->assertSame('…', $columns[31]->title()); } } diff --git a/tests/app/Census/CensusOfUnitedStates1940Test.php b/tests/app/Census/CensusOfUnitedStates1940Test.php deleted file mode 100644 index 4be92d6563..0000000000 --- a/tests/app/Census/CensusOfUnitedStates1940Test.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -/** - * webtrees: online genealogy - * Copyright (C) 2015 webtrees development team - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -namespace Fisharebest\Webtrees\Census; - -/** - * Test harness for the class CensusOfUnitedStates1940 - */ -class CensusOfUnitedStates1940Test extends \PHPUnit_Framework_TestCase { - /** - * Test the census place and date - * - * @covers Fisharebest\Webtrees\Census\CensusOfUnitedStates1940 - */ - public function testPlaceAndDate() { - $census = new CensusOfUnitedStates1940; - - $this->assertSame('United States', $census->censusPlace()); - $this->assertSame('01 APR 1940', $census->censusDate()); - } - - /** - * Test the census columns - * - * @covers Fisharebest\Webtrees\Census\CensusOfUnitedStates1940 - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn - */ - public function testColumns() { - $census = new CensusOfUnitedStates1940; - $columns = $census->columns(); - - $this->assertCount(1, $columns); - $this->assertInstanceOf(CensusColumnNull::class, $columns[0]); - - $this->assertSame('XXXX', $columns[0]->abbreviation()); - - $this->assertSame('XXXX', $columns[0]->title()); - } -} diff --git a/tests/app/Census/CensusOfUnitedStatesTest.php b/tests/app/Census/CensusOfUnitedStatesTest.php index 91e2d9a94f..5bd14ef636 100644 --- a/tests/app/Census/CensusOfUnitedStatesTest.php +++ b/tests/app/Census/CensusOfUnitedStatesTest.php @@ -42,7 +42,7 @@ class CensusOfUnitedStatesTest extends \PHPUnit_Framework_TestCase { $census_dates = $census->allCensusDates(); - $this->assertCount(10, $census_dates); + $this->assertCount(9, $census_dates); $this->assertInstanceOf(CensusOfUnitedStates1850::class, $census_dates[0]); $this->assertInstanceOf(CensusOfUnitedStates1860::class, $census_dates[1]); $this->assertInstanceOf(CensusOfUnitedStates1870::class, $census_dates[2]); @@ -52,6 +52,5 @@ class CensusOfUnitedStatesTest extends \PHPUnit_Framework_TestCase { $this->assertInstanceOf(CensusOfUnitedStates1910::class, $census_dates[6]); $this->assertInstanceOf(CensusOfUnitedStates1920::class, $census_dates[7]); $this->assertInstanceOf(CensusOfUnitedStates1930::class, $census_dates[8]); - $this->assertInstanceOf(CensusOfUnitedStates1940::class, $census_dates[9]); } } |
