summaryrefslogtreecommitdiff
path: root/tests/app
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2015-10-07 13:31:46 +0100
committerGreg Roach <fisharebest@gmail.com>2015-10-07 13:31:46 +0100
commitb26116c93fc2030fb2b07a782c69484dc7536947 (patch)
tree1f79bb4e8f10a767769270d62c6776790c28d5c4 /tests/app
parent548ca0dd332bc2ccd2184fad673fab4643826e17 (diff)
downloadwebtrees-b26116c93fc2030fb2b07a782c69484dc7536947.tar.gz
webtrees-b26116c93fc2030fb2b07a782c69484dc7536947.tar.bz2
webtrees-b26116c93fc2030fb2b07a782c69484dc7536947.zip
Census
Diffstat (limited to 'tests/app')
-rw-r--r--tests/app/Census/CensusColumnConditionDanishTest.php2
-rw-r--r--tests/app/Census/CensusColumnDateOfBirthTest.php50
2 files changed, 51 insertions, 1 deletions
diff --git a/tests/app/Census/CensusColumnConditionDanishTest.php b/tests/app/Census/CensusColumnConditionDanishTest.php
index 6b7e7c6bce..c7163481a7 100644
--- a/tests/app/Census/CensusColumnConditionDanishTest.php
+++ b/tests/app/Census/CensusColumnConditionDanishTest.php
@@ -41,7 +41,7 @@ class CensusColumnConditionDanishTest extends \PHPUnit_Framework_TestCase {
$census = Mockery::mock(CensusInterface::class);
- $column = new CensusColumnCondition($census, '', '');
+ $column = new CensusColumnConditionDnish($census, '', '');
$this->assertSame('', $column->generate($individual));
}
diff --git a/tests/app/Census/CensusColumnDateOfBirthTest.php b/tests/app/Census/CensusColumnDateOfBirthTest.php
new file mode 100644
index 0000000000..dfc75a0e78
--- /dev/null
+++ b/tests/app/Census/CensusColumnDateOfBirthTest.php
@@ -0,0 +1,50 @@
+<?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;
+
+use Fisharebest\Webtrees\Date;
+use Fisharebest\Webtrees\Individual;
+use Mockery;
+
+/**
+ * Test harness for the class CensusColumnAge
+ */
+class CensusColumnDateOfBirthTest extends \PHPUnit_Framework_TestCase {
+ /**
+ * Delete mock objects
+ */
+ public function tearDown() {
+ Mockery::close();
+ }
+
+ /**
+ * @covers Fisharebest\Webtrees\Census\CensusColumnAge
+ * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn
+ */
+ public function testGenerateColumn() {
+ $individual = Mockery::mock(Individual::class);
+ $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('01 JAN 1800'));
+
+ $census = Mockery::mock(CensusInterface::class);
+ $census->shouldReceive('censusDate')->andReturn('30 JUN 1832');
+
+ $column = new CensusColumnDateOfBirth($census, '', '');
+
+ $this->assertSame('32', $column->generate($individual));
+ }
+}