xref: /webtrees/tests/app/Census/CensusOfScotland1841Test.php (revision db7d25eeb5ba43cdc3662cbee9ceabb8d61c7ab5)
1*db7d25eeSGreg Roach<?php
2*db7d25eeSGreg Roach
3*db7d25eeSGreg Roach/**
4*db7d25eeSGreg Roach * webtrees: online genealogy
5*db7d25eeSGreg Roach * Copyright (C) 2015 webtrees development team
6*db7d25eeSGreg Roach * This program is free software: you can redistribute it and/or modify
7*db7d25eeSGreg Roach * it under the terms of the GNU General Public License as published by
8*db7d25eeSGreg Roach * the Free Software Foundation, either version 3 of the License, or
9*db7d25eeSGreg Roach * (at your option) any later version.
10*db7d25eeSGreg Roach * This program is distributed in the hope that it will be useful,
11*db7d25eeSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12*db7d25eeSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13*db7d25eeSGreg Roach * GNU General Public License for more details.
14*db7d25eeSGreg Roach * You should have received a copy of the GNU General Public License
15*db7d25eeSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
16*db7d25eeSGreg Roach */
17*db7d25eeSGreg Roach
18*db7d25eeSGreg Roachnamespace Fisharebest\Webtrees\Census;
19*db7d25eeSGreg Roach
20*db7d25eeSGreg Roach/**
21*db7d25eeSGreg Roach * Test harness for the class CensusOfScotland1841
22*db7d25eeSGreg Roach */
23*db7d25eeSGreg Roachclass CensusOfScotland1841Test extends \PHPUnit_Framework_TestCase {
24*db7d25eeSGreg Roach	/**
25*db7d25eeSGreg Roach	 * Test the census place and date
26*db7d25eeSGreg Roach	 */
27*db7d25eeSGreg Roach	public function testPlaceAndDate() {
28*db7d25eeSGreg Roach		$census = new CensusOfScotland1841;
29*db7d25eeSGreg Roach
30*db7d25eeSGreg Roach		$this->assertSame('Scotland', $census->censusPlace());
31*db7d25eeSGreg Roach		$this->assertSame('06 MAY 1841', $census->censusDate());
32*db7d25eeSGreg Roach	}
33*db7d25eeSGreg Roach
34*db7d25eeSGreg Roach	/**
35*db7d25eeSGreg Roach	 * Test the census place and date
36*db7d25eeSGreg Roach	 */
37*db7d25eeSGreg Roach	public function testColumns() {
38*db7d25eeSGreg Roach		$census  = new CensusOfScotland1841;
39*db7d25eeSGreg Roach		$columns = $census->columns();
40*db7d25eeSGreg Roach
41*db7d25eeSGreg Roach		$this->assertCount(6, $columns);
42*db7d25eeSGreg Roach		$this->assertInstanceOf(CensusColumnFullName::class, $columns[0]);
43*db7d25eeSGreg Roach		$this->assertInstanceOf(CensusColumnAgeMale5Years::class, $columns[1]);
44*db7d25eeSGreg Roach		$this->assertInstanceOf(CensusColumnAgeFemale5Years::class, $columns[2]);
45*db7d25eeSGreg Roach		$this->assertInstanceOf(CensusColumnOccupation::class, $columns[3]);
46*db7d25eeSGreg Roach		$this->assertInstanceOf(CensusColumnBornSameCounty::class, $columns[4]);
47*db7d25eeSGreg Roach		$this->assertInstanceOf(CensusColumnBornForeignParts::class, $columns[5]);
48*db7d25eeSGreg Roach	}
49*db7d25eeSGreg Roach}
50