diff options
| -rw-r--r-- | app/Census/CensusOfDenmark1835.php | 2 | ||||
| -rw-r--r-- | tests/app/Census/CensusOfDenmark1803Test.php | 65 | ||||
| -rw-r--r-- | tests/app/Census/CensusOfDenmark1835Test.php | 65 |
3 files changed, 131 insertions, 1 deletions
diff --git a/app/Census/CensusOfDenmark1835.php b/app/Census/CensusOfDenmark1835.php index 33cb22591f..0d07506c7c 100644 --- a/app/Census/CensusOfDenmark1835.php +++ b/app/Census/CensusOfDenmark1835.php @@ -27,7 +27,7 @@ class CensusOfDenmark1835 extends CensusOfDenmark implements CensusInterface { * @return string */ public function censusDate() { - return '18 FEB 1834'; + return '18 FEB 1835'; } /** diff --git a/tests/app/Census/CensusOfDenmark1803Test.php b/tests/app/Census/CensusOfDenmark1803Test.php new file mode 100644 index 0000000000..1192f46422 --- /dev/null +++ b/tests/app/Census/CensusOfDenmark1803Test.php @@ -0,0 +1,65 @@ +<?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 CensusOfDenmark1803 + */ +class CensusOfDenmark1803Test extends \PHPUnit_Framework_TestCase { + /** + * Test the census place and date + * + * @covers Fisharebest\Webtrees\Census\CensusOfDenmark1803 + */ + public function testPlaceAndDate() { + $census = new CensusOfDenmark1803; + + $this->assertSame('Schleswig-Holstein, Deutschland', $census->censusPlace()); + $this->assertSame('01 FEB 1803', $census->censusDate()); + } + + /** + * Test the census columns + * + * @covers Fisharebest\Webtrees\Census\CensusOfDenmark1803 + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testColumns() { + $census = new CensusOfDenmark1803; + $columns = $census->columns(); + + $this->assertCount(5, $columns); + $this->assertInstanceOf(CensusColumnFullName::class, $columns[0]); + $this->assertInstanceOf(CensusColumnAge::class, $columns[1]); + $this->assertInstanceOf(CensusColumnCondition::class, $columns[2]); + $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[3]); + $this->assertInstanceOf(CensusColumnOccupation::class, $columns[4]); + + $this->assertSame('TBC', $columns[0]->abbreviation()); + $this->assertSame('TBC', $columns[1]->abbreviation()); + $this->assertSame('TBC', $columns[2]->abbreviation()); + $this->assertSame('TBC', $columns[3]->abbreviation()); + $this->assertSame('TBC', $columns[4]->abbreviation()); + + $this->assertSame('To be confirmed', $columns[0]->title()); + $this->assertSame('To be confirmed', $columns[1]->title()); + $this->assertSame('To be confirmed', $columns[2]->title()); + $this->assertSame('To be confirmed', $columns[3]->title()); + $this->assertSame('To be confirmed', $columns[4]->title()); + } +} diff --git a/tests/app/Census/CensusOfDenmark1835Test.php b/tests/app/Census/CensusOfDenmark1835Test.php new file mode 100644 index 0000000000..b542a5c6b0 --- /dev/null +++ b/tests/app/Census/CensusOfDenmark1835Test.php @@ -0,0 +1,65 @@ +<?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 CensusOfDenmark1835 + */ +class CensusOfDenmark1835Test extends \PHPUnit_Framework_TestCase { + /** + * Test the census place and date + * + * @covers Fisharebest\Webtrees\Census\CensusOfDenmark1835 + */ + public function testPlaceAndDate() { + $census = new CensusOfDenmark1835; + + $this->assertSame('Schleswig-Holstein, Deutschland', $census->censusPlace()); + $this->assertSame('18 FEB 1835', $census->censusDate()); + } + + /** + * Test the census columns + * + * @covers Fisharebest\Webtrees\Census\CensusOfDenmark1835 + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testColumns() { + $census = new CensusOfDenmark1835; + $columns = $census->columns(); + + $this->assertCount(5, $columns); + $this->assertInstanceOf(CensusColumnFullName::class, $columns[0]); + $this->assertInstanceOf(CensusColumnAge::class, $columns[1]); + $this->assertInstanceOf(CensusColumnCondition::class, $columns[2]); + $this->assertInstanceOf(CensusColumnRelationToHead::class, $columns[3]); + $this->assertInstanceOf(CensusColumnOccupation::class, $columns[4]); + + $this->assertSame('TBC', $columns[0]->abbreviation()); + $this->assertSame('TBC', $columns[1]->abbreviation()); + $this->assertSame('TBC', $columns[2]->abbreviation()); + $this->assertSame('TBC', $columns[3]->abbreviation()); + $this->assertSame('TBC', $columns[4]->abbreviation()); + + $this->assertSame('To be confirmed', $columns[0]->title()); + $this->assertSame('To be confirmed', $columns[1]->title()); + $this->assertSame('To be confirmed', $columns[2]->title()); + $this->assertSame('To be confirmed', $columns[3]->title()); + $this->assertSame('To be confirmed', $columns[4]->title()); + } +} |
