. */ namespace Fisharebest\Webtrees\Census; /** * Test harness for the class CensusOfUnitedStates1930 */ class CensusOfUnitedStates1930Test extends \PHPUnit_Framework_TestCase { /** * Test the census place and date * * @covers Fisharebest\Webtrees\Census\CensusOfUnitedStates1930 */ public function testPlaceAndDate() { $census = new CensusOfUnitedStates1930; $this->assertSame('United States', $census->censusPlace()); $this->assertSame('APR 1930', $census->censusDate()); } /** * Test the census columns * * @covers Fisharebest\Webtrees\Census\CensusOfUnitedStates1930 * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testColumns() { $census = new CensusOfUnitedStates1930; $columns = $census->columns(); $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('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('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()); } }