summaryrefslogtreecommitdiff
path: root/tests/app/Census/CensusColumnBirthMonthDayTest.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2021-05-18 10:02:53 +0100
committerGreg Roach <fisharebest@gmail.com>2021-05-18 10:02:53 +0100
commita63e8302ecf4afc9b5c8302eba5d9f23c46cd48c (patch)
tree2a2f1cbd11d61edd06ee3763809866d5ddae5e4b /tests/app/Census/CensusColumnBirthMonthDayTest.php
parent3eb619d2481a5f5c40b4c523c66127b79c11c7ee (diff)
downloadwebtrees-a63e8302ecf4afc9b5c8302eba5d9f23c46cd48c.tar.gz
webtrees-a63e8302ecf4afc9b5c8302eba5d9f23c46cd48c.tar.bz2
webtrees-a63e8302ecf4afc9b5c8302eba5d9f23c46cd48c.zip
Testing
Diffstat (limited to 'tests/app/Census/CensusColumnBirthMonthDayTest.php')
-rw-r--r--tests/app/Census/CensusColumnBirthMonthDayTest.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/app/Census/CensusColumnBirthMonthDayTest.php b/tests/app/Census/CensusColumnBirthMonthDayTest.php
new file mode 100644
index 0000000000..e7bc107a4a
--- /dev/null
+++ b/tests/app/Census/CensusColumnBirthMonthDayTest.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2021 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 <https://www.gnu.org/licenses/>.
+ */
+
+declare(strict_types=1);
+
+namespace Fisharebest\Webtrees\Census;
+
+use Fisharebest\Webtrees\Date;
+use Fisharebest\Webtrees\Individual;
+use Fisharebest\Webtrees\TestCase;
+
+/**
+ * Test harness for the class CensusColumnBirthDayMonthSlashYearTest
+ */
+class CensusColumnBirthMonthDayTest extends TestCase
+{
+ /**
+ * @covers \Fisharebest\Webtrees\Census\CensusColumnBirthMonthDay
+ * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
+ *
+ * @return void
+ */
+ public function testGenerateColumn(): void
+ {
+ $individual = self::createMock(Individual::class);
+ $individual->method('getEstimatedBirthDate')->willReturn(new Date('02 MAR 1800'));
+
+ $census = self::createMock(CensusInterface::class);
+ $census->method('censusDate')->willReturn('30 JUN 1832');
+
+ $column = new CensusColumnBirthMonthDay($census, '', '');
+
+ self::assertSame('Mar 2', $column->generate($individual, $individual));
+ }
+}