summaryrefslogtreecommitdiff
path: root/tests/app/Census/CensusColumnBirthMonthTest.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2015-10-29 13:27:40 +0000
committerGreg Roach <fisharebest@gmail.com>2015-10-29 17:34:39 +0000
commitf3fa6d90bdc7225bdbe6300f0588c5935d1cc217 (patch)
tree7f2428fee6b7c0d0e765d3f0815ac04d0881ddf7 /tests/app/Census/CensusColumnBirthMonthTest.php
parent0b18a98d2ceaeebc288d72a27a147055f7d6115d (diff)
downloadwebtrees-f3fa6d90bdc7225bdbe6300f0588c5935d1cc217.tar.gz
webtrees-f3fa6d90bdc7225bdbe6300f0588c5935d1cc217.tar.bz2
webtrees-f3fa6d90bdc7225bdbe6300f0588c5935d1cc217.zip
US Census
Diffstat (limited to 'tests/app/Census/CensusColumnBirthMonthTest.php')
-rw-r--r--tests/app/Census/CensusColumnBirthMonthTest.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/app/Census/CensusColumnBirthMonthTest.php b/tests/app/Census/CensusColumnBirthMonthTest.php
new file mode 100644
index 0000000000..75aed25829
--- /dev/null
+++ b/tests/app/Census/CensusColumnBirthMonthTest.php
@@ -0,0 +1,56 @@
+<?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 CensusColumnBirthMonthTest extends \PHPUnit_Framework_TestCase {
+ /**
+ * Delete mock objects
+ */
+ public function tearDown() {
+ Mockery::close();
+ }
+
+ /**
+ * @covers Fisharebest\Webtrees\Census\CensusColumnBirthMonth
+ * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn
+ */
+ public function testGenerateColumn() {
+ $cal_date = Mockery::mock(Date\CalendarDate::class);
+ $cal_date->shouldReceive('format')->andReturn('Jan');
+
+ $date = Mockery::mock(Date::class);
+ $date->shouldReceive('minimumDate')->andReturn($cal_date);
+
+ $individual = Mockery::mock(Individual::class);
+ $individual->shouldReceive('getEstimatedBirthDate')->andReturn($date);
+
+ $census = Mockery::mock(CensusInterface::class);
+ $census->shouldReceive('censusDate')->andReturn('30 JUN 1832');
+
+ $column = new CensusColumnBirthMonth($census, '', '');
+
+ $this->assertSame('Jan', $column->generate($individual));
+ }
+}