xref: /webtrees/tests/app/Census/CensusColumnBirthMonthDayTest.php (revision 5a8afed46297e8105e3e5a33ce37e6a8e88bc79d)
1a63e8302SGreg Roach<?php
2a63e8302SGreg Roach
3a63e8302SGreg Roach/**
4a63e8302SGreg Roach * webtrees: online genealogy
5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
6a63e8302SGreg Roach * This program is free software: you can redistribute it and/or modify
7a63e8302SGreg Roach * it under the terms of the GNU General Public License as published by
8a63e8302SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9a63e8302SGreg Roach * (at your option) any later version.
10a63e8302SGreg Roach * This program is distributed in the hope that it will be useful,
11a63e8302SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12a63e8302SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13a63e8302SGreg Roach * GNU General Public License for more details.
14a63e8302SGreg Roach * You should have received a copy of the GNU General Public License
15a63e8302SGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16a63e8302SGreg Roach */
17a63e8302SGreg Roach
18a63e8302SGreg Roachdeclare(strict_types=1);
19a63e8302SGreg Roach
20a63e8302SGreg Roachnamespace Fisharebest\Webtrees\Census;
21a63e8302SGreg Roach
22a63e8302SGreg Roachuse Fisharebest\Webtrees\Date;
23a63e8302SGreg Roachuse Fisharebest\Webtrees\Individual;
24a63e8302SGreg Roachuse Fisharebest\Webtrees\TestCase;
25*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass;
26a63e8302SGreg Roach
27*202c018bSGreg Roach#[CoversClass(CensusColumnBirthMonthDay::class)]
28*202c018bSGreg Roach#[CoversClass(AbstractCensusColumn::class)]
29a63e8302SGreg Roachclass CensusColumnBirthMonthDayTest extends TestCase
30a63e8302SGreg Roach{
31a63e8302SGreg Roach    public function testGenerateColumn(): void
32a63e8302SGreg Roach    {
33cd94ca66SGreg Roach        $individual = $this->createMock(Individual::class);
34a63e8302SGreg Roach        $individual->method('getEstimatedBirthDate')->willReturn(new Date('02 MAR 1800'));
35a63e8302SGreg Roach
36cd94ca66SGreg Roach        $census = $this->createMock(CensusInterface::class);
37a63e8302SGreg Roach        $census->method('censusDate')->willReturn('30 JUN 1832');
38a63e8302SGreg Roach
39a63e8302SGreg Roach        $column = new CensusColumnBirthMonthDay($census, '', '');
40a63e8302SGreg Roach
41a63e8302SGreg Roach        self::assertSame('Mar 2', $column->generate($individual, $individual));
42a63e8302SGreg Roach    }
43a63e8302SGreg Roach}
44