xref: /webtrees/tests/app/Census/CensusOfDenmark1803Test.php (revision c314ecc9a18e5e740a1c0fcb7379ef541f969dc5)
1548ca0ddSGreg Roach<?php
2548ca0ddSGreg Roach
3548ca0ddSGreg Roach/**
4548ca0ddSGreg Roach * webtrees: online genealogy
5548ca0ddSGreg Roach * Copyright (C) 2015 webtrees development team
6548ca0ddSGreg Roach * This program is free software: you can redistribute it and/or modify
7548ca0ddSGreg Roach * it under the terms of the GNU General Public License as published by
8548ca0ddSGreg Roach * the Free Software Foundation, either version 3 of the License, or
9548ca0ddSGreg Roach * (at your option) any later version.
10548ca0ddSGreg Roach * This program is distributed in the hope that it will be useful,
11548ca0ddSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12548ca0ddSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13548ca0ddSGreg Roach * GNU General Public License for more details.
14548ca0ddSGreg Roach * You should have received a copy of the GNU General Public License
15548ca0ddSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
16548ca0ddSGreg Roach */
17548ca0ddSGreg Roachnamespace Fisharebest\Webtrees\Census;
18548ca0ddSGreg Roach
19548ca0ddSGreg Roach/**
20548ca0ddSGreg Roach * Test harness for the class CensusOfDenmark1803
21548ca0ddSGreg Roach */
22548ca0ddSGreg Roachclass CensusOfDenmark1803Test extends \PHPUnit_Framework_TestCase {
23548ca0ddSGreg Roach	/**
24548ca0ddSGreg Roach	 * Test the census place and date
25548ca0ddSGreg Roach	 *
26548ca0ddSGreg Roach	 * @covers Fisharebest\Webtrees\Census\CensusOfDenmark1803
27548ca0ddSGreg Roach	 */
28548ca0ddSGreg Roach	public function testPlaceAndDate() {
29548ca0ddSGreg Roach		$census = new CensusOfDenmark1803;
30548ca0ddSGreg Roach
31548ca0ddSGreg Roach		$this->assertSame('Schleswig-Holstein, Deutschland', $census->censusPlace());
32548ca0ddSGreg Roach		$this->assertSame('01 FEB 1803', $census->censusDate());
33548ca0ddSGreg Roach	}
34548ca0ddSGreg Roach
35548ca0ddSGreg Roach	/**
36548ca0ddSGreg Roach	 * Test the census columns
37548ca0ddSGreg Roach	 *
38548ca0ddSGreg Roach	 * @covers Fisharebest\Webtrees\Census\CensusOfDenmark1803
39548ca0ddSGreg Roach	 * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn
40548ca0ddSGreg Roach	 */
41548ca0ddSGreg Roach	public function testColumns() {
42548ca0ddSGreg Roach		$census  = new CensusOfDenmark1803;
43548ca0ddSGreg Roach		$columns = $census->columns();
44548ca0ddSGreg Roach
45548ca0ddSGreg Roach		$this->assertCount(5, $columns);
46*c314ecc9SGreg Roach		$this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnFullName', $columns[0]);
47*c314ecc9SGreg Roach		$this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[1]);
48*c314ecc9SGreg Roach		$this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[2]);
49*c314ecc9SGreg Roach		$this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionDanish', $columns[3]);
50*c314ecc9SGreg Roach		$this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[4]);
51548ca0ddSGreg Roach
524c219c47SGreg Roach		$this->assertSame('Navn', $columns[0]->abbreviation());
534c219c47SGreg Roach		$this->assertSame('Stilling i familien', $columns[1]->abbreviation());
544c219c47SGreg Roach		$this->assertSame('Alder', $columns[2]->abbreviation());
554c219c47SGreg Roach		$this->assertSame('Civilstand', $columns[3]->abbreviation());
564c219c47SGreg Roach		$this->assertSame('Erhverv', $columns[4]->abbreviation());
57548ca0ddSGreg Roach
584c219c47SGreg Roach		$this->assertSame('', $columns[0]->title());
594c219c47SGreg Roach		$this->assertSame('', $columns[1]->title());
604c219c47SGreg Roach		$this->assertSame('', $columns[2]->title());
614c219c47SGreg Roach		$this->assertSame('', $columns[3]->title());
624c219c47SGreg Roach		$this->assertSame('', $columns[4]->title());
63548ca0ddSGreg Roach	}
64548ca0ddSGreg Roach}
65