summaryrefslogtreecommitdiff
path: root/tests/app/Census/CensusColumnBirthMonthDayTest.php
diff options
context:
space:
mode:
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));
+ }
+}