128ae205eSDavid Drury<?php 228ae205eSDavid Drury 328ae205eSDavid Drury/** 428ae205eSDavid Drury * webtrees: online genealogy 5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team 628ae205eSDavid Drury * This program is free software: you can redistribute it and/or modify 728ae205eSDavid Drury * it under the terms of the GNU General Public License as published by 828ae205eSDavid Drury * the Free Software Foundation, either version 3 of the License, or 928ae205eSDavid Drury * (at your option) any later version. 1028ae205eSDavid Drury * This program is distributed in the hope that it will be useful, 1128ae205eSDavid Drury * but WITHOUT ANY WARRANTY; without even the implied warranty of 1228ae205eSDavid Drury * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1328ae205eSDavid Drury * GNU General Public License for more details. 1428ae205eSDavid Drury * You should have received a copy of the GNU General Public License 1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>. 1628ae205eSDavid Drury */ 1728ae205eSDavid Drury 1828ae205eSDavid Drurydeclare(strict_types=1); 1928ae205eSDavid Drury 2028ae205eSDavid Drurynamespace Fisharebest\Webtrees\Census; 2128ae205eSDavid Drury 2228ae205eSDavid Druryuse Fisharebest\Webtrees\Date; 2328ae205eSDavid Druryuse Fisharebest\Webtrees\Individual; 2428ae205eSDavid Druryuse Fisharebest\Webtrees\TestCase; 25*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass; 2628ae205eSDavid Drury 27*202c018bSGreg Roach#[CoversClass(CensusColumnBirthDayMonthYear::class)] 28*202c018bSGreg Roach#[CoversClass(AbstractCensusColumn::class)] 2928ae205eSDavid Druryclass CensusColumnBirthDayMonthYearTest extends TestCase 3028ae205eSDavid Drury{ 3128ae205eSDavid Drury public function testGenerateColumn(): void 3228ae205eSDavid Drury { 33cd94ca66SGreg Roach $individual = $this->createMock(Individual::class); 34b72623feSGreg Roach $individual->method('getEstimatedBirthDate')->willReturn(new Date('02 MAR 1800')); 3528ae205eSDavid Drury 36cd94ca66SGreg Roach $census = $this->createMock(CensusInterface::class); 3728ae205eSDavid Drury $census->method('censusDate')->willReturn('30 JUN 1832'); 3828ae205eSDavid Drury 3928ae205eSDavid Drury $column = new CensusColumnBirthDayMonthYear($census, '', ''); 4028ae205eSDavid Drury 41b72623feSGreg Roach self::assertSame('2 Mar 1800', $column->generate($individual, $individual)); 4228ae205eSDavid Drury } 4328ae205eSDavid Drury} 44