xref: /webtrees/tests/app/Census/CensusOfDenmark1803Test.php (revision 84e2cf4e2b1803b300330f631d304db1a3c443dd)
1548ca0ddSGreg Roach<?php
2548ca0ddSGreg Roach/**
3548ca0ddSGreg Roach * webtrees: online genealogy
41062a142SGreg Roach * Copyright (C) 2018 webtrees development team
5548ca0ddSGreg Roach * This program is free software: you can redistribute it and/or modify
6548ca0ddSGreg Roach * it under the terms of the GNU General Public License as published by
7548ca0ddSGreg Roach * the Free Software Foundation, either version 3 of the License, or
8548ca0ddSGreg Roach * (at your option) any later version.
9548ca0ddSGreg Roach * This program is distributed in the hope that it will be useful,
10548ca0ddSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
11548ca0ddSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12548ca0ddSGreg Roach * GNU General Public License for more details.
13548ca0ddSGreg Roach * You should have received a copy of the GNU General Public License
14548ca0ddSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
15548ca0ddSGreg Roach */
16548ca0ddSGreg Roachnamespace Fisharebest\Webtrees\Census;
17548ca0ddSGreg Roach
18548ca0ddSGreg Roach/**
19548ca0ddSGreg Roach * Test harness for the class CensusOfDenmark1803
20548ca0ddSGreg Roach */
21*84e2cf4eSGreg Roachclass CensusOfDenmark1803Test extends \Fisharebest\Webtrees\TestCase
22c1010edaSGreg Roach{
23548ca0ddSGreg Roach    /**
24548ca0ddSGreg Roach     * Test the census place and date
25548ca0ddSGreg Roach     *
2615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfDenmark1803
27548ca0ddSGreg Roach     */
28c1010edaSGreg Roach    public function testPlaceAndDate()
29c1010edaSGreg Roach    {
30548ca0ddSGreg Roach        $census = new CensusOfDenmark1803;
31548ca0ddSGreg Roach
32548ca0ddSGreg Roach        $this->assertSame('Schleswig-Holstein, Deutschland', $census->censusPlace());
33548ca0ddSGreg Roach        $this->assertSame('01 FEB 1803', $census->censusDate());
34548ca0ddSGreg Roach    }
35548ca0ddSGreg Roach
36548ca0ddSGreg Roach    /**
37548ca0ddSGreg Roach     * Test the census columns
38548ca0ddSGreg Roach     *
3915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusOfDenmark1803
4015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
41548ca0ddSGreg Roach     */
42c1010edaSGreg Roach    public function testColumns()
43c1010edaSGreg Roach    {
44548ca0ddSGreg Roach        $census  = new CensusOfDenmark1803;
45548ca0ddSGreg Roach        $columns = $census->columns();
46548ca0ddSGreg Roach
47548ca0ddSGreg Roach        $this->assertCount(5, $columns);
48c314ecc9SGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnFullName', $columns[0]);
49c314ecc9SGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[1]);
50c314ecc9SGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[2]);
51c314ecc9SGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionDanish', $columns[3]);
52c314ecc9SGreg Roach        $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[4]);
53548ca0ddSGreg Roach
544c219c47SGreg Roach        $this->assertSame('Navn', $columns[0]->abbreviation());
554c219c47SGreg Roach        $this->assertSame('Stilling i familien', $columns[1]->abbreviation());
564c219c47SGreg Roach        $this->assertSame('Alder', $columns[2]->abbreviation());
574c219c47SGreg Roach        $this->assertSame('Civilstand', $columns[3]->abbreviation());
584c219c47SGreg Roach        $this->assertSame('Erhverv', $columns[4]->abbreviation());
59548ca0ddSGreg Roach
604c219c47SGreg Roach        $this->assertSame('', $columns[0]->title());
614c219c47SGreg Roach        $this->assertSame('', $columns[1]->title());
624c219c47SGreg Roach        $this->assertSame('', $columns[2]->title());
634c219c47SGreg Roach        $this->assertSame('', $columns[3]->title());
644c219c47SGreg Roach        $this->assertSame('', $columns[4]->title());
65548ca0ddSGreg Roach    }
66548ca0ddSGreg Roach}
67