188cd6753SGreg Roach<?php 23976b470SGreg Roach 388cd6753SGreg Roach/** 488cd6753SGreg Roach * webtrees: online genealogy 5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team 688cd6753SGreg Roach * This program is free software: you can redistribute it and/or modify 788cd6753SGreg Roach * it under the terms of the GNU General Public License as published by 888cd6753SGreg Roach * the Free Software Foundation, either version 3 of the License, or 988cd6753SGreg Roach * (at your option) any later version. 1088cd6753SGreg Roach * This program is distributed in the hope that it will be useful, 1188cd6753SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 1288cd6753SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1388cd6753SGreg Roach * GNU General Public License for more details. 1488cd6753SGreg Roach * 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/>. 1688cd6753SGreg Roach */ 17fcfa147eSGreg Roach 18e7f56f2aSGreg Roachdeclare(strict_types=1); 19e7f56f2aSGreg Roach 2088cd6753SGreg Roachnamespace Fisharebest\Webtrees\Census; 2188cd6753SGreg Roach 22ddf438a5SGreg Roachuse Fisharebest\Webtrees\Date; 23ddf438a5SGreg Roachuse Fisharebest\Webtrees\Individual; 243cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase; 25*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass; 2688cd6753SGreg Roach 27*202c018bSGreg Roach#[CoversClass(CensusColumnBirthDate::class)] 28*202c018bSGreg Roach#[CoversClass(AbstractCensusColumn::class)] 293cfcc809SGreg Roachclass CensusColumnBirthDateTest extends TestCase 30c1010edaSGreg Roach{ 319b802b22SGreg Roach public function testGenerateColumn(): void 32c1010edaSGreg Roach { 33cd94ca66SGreg Roach $individual = $this->createMock(Individual::class); 34b72623feSGreg Roach $individual->method('getEstimatedBirthDate')->willReturn(new Date('02 MAR 1800')); 3588cd6753SGreg Roach 36cd94ca66SGreg Roach $census = $this->createMock(CensusInterface::class); 370ecdbde6SGreg Roach $census->method('censusDate')->willReturn('30 JUN 1832'); 3888cd6753SGreg Roach 3988cd6753SGreg Roach $column = new CensusColumnBirthDate($census, '', ''); 4088cd6753SGreg Roach 41b72623feSGreg Roach self::assertSame('2 3 1800', $column->generate($individual, $individual)); 4288cd6753SGreg Roach } 4388cd6753SGreg Roach} 44