188cd6753SGreg Roach<?php 23976b470SGreg Roach 388cd6753SGreg Roach/** 488cd6753SGreg Roach * webtrees: online genealogy 589f7189bSGreg Roach * Copyright (C) 2021 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; 2588cd6753SGreg Roach 2688cd6753SGreg Roach/** 2788cd6753SGreg Roach * Test harness for the class CensusColumnAge 2888cd6753SGreg Roach */ 293cfcc809SGreg Roachclass CensusColumnBirthDateTest extends TestCase 30c1010edaSGreg Roach{ 3188cd6753SGreg Roach /** 3215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBirthDate 3315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 3452348eb8SGreg Roach * 3552348eb8SGreg Roach * @return void 3688cd6753SGreg Roach */ 379b802b22SGreg Roach public function testGenerateColumn(): void 38c1010edaSGreg Roach { 395e933c21SGreg Roach $individual = self::createMock(Individual::class); 40*b72623feSGreg Roach $individual->method('getEstimatedBirthDate')->willReturn(new Date('02 MAR 1800')); 4188cd6753SGreg Roach 425e933c21SGreg Roach $census = self::createMock(CensusInterface::class); 430ecdbde6SGreg Roach $census->method('censusDate')->willReturn('30 JUN 1832'); 4488cd6753SGreg Roach 4588cd6753SGreg Roach $column = new CensusColumnBirthDate($census, '', ''); 4688cd6753SGreg Roach 47*b72623feSGreg Roach self::assertSame('2 3 1800', $column->generate($individual, $individual)); 4888cd6753SGreg Roach } 4988cd6753SGreg Roach} 50