1f3fa6d90SGreg Roach<?php 23976b470SGreg Roach 3f3fa6d90SGreg Roach/** 4f3fa6d90SGreg Roach * webtrees: online genealogy 58fcd0d32SGreg Roach * Copyright (C) 2019 webtrees development team 6f3fa6d90SGreg Roach * This program is free software: you can redistribute it and/or modify 7f3fa6d90SGreg Roach * it under the terms of the GNU General Public License as published by 8f3fa6d90SGreg Roach * the Free Software Foundation, either version 3 of the License, or 9f3fa6d90SGreg Roach * (at your option) any later version. 10f3fa6d90SGreg Roach * This program is distributed in the hope that it will be useful, 11f3fa6d90SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 12f3fa6d90SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13f3fa6d90SGreg Roach * GNU General Public License for more details. 14f3fa6d90SGreg Roach * You should have received a copy of the GNU General Public License 15f3fa6d90SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 16f3fa6d90SGreg Roach */ 17e7f56f2aSGreg Roachdeclare(strict_types=1); 18e7f56f2aSGreg Roach 19f3fa6d90SGreg Roachnamespace Fisharebest\Webtrees\Census; 20f3fa6d90SGreg Roach 21ddf438a5SGreg Roachuse Fisharebest\Webtrees\Date; 22ddf438a5SGreg Roachuse Fisharebest\Webtrees\Date\GregorianDate; 23ddf438a5SGreg Roachuse Fisharebest\Webtrees\Individual; 24*3cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase; 25f3fa6d90SGreg Roach 26f3fa6d90SGreg Roach/** 27f3fa6d90SGreg Roach * Test harness for the class CensusColumnAge 28f3fa6d90SGreg Roach */ 29*3cfcc809SGreg Roachclass CensusColumnBirthMonthTest extends TestCase 30c1010edaSGreg Roach{ 31f3fa6d90SGreg Roach /** 3215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBirthMonth 3315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 3452348eb8SGreg Roach * 3552348eb8SGreg Roach * @return void 36f3fa6d90SGreg Roach */ 379b802b22SGreg Roach public function testGenerateColumn(): void 38c1010edaSGreg Roach { 390ecdbde6SGreg Roach $cal_date = $this->createMock(GregorianDate::class); 400ecdbde6SGreg Roach $cal_date->method('format')->willReturn('Jan'); 41f3fa6d90SGreg Roach 420ecdbde6SGreg Roach $date = $this->createMock(Date::class); 430ecdbde6SGreg Roach $date->method('minimumDate')->willReturn($cal_date); 44f3fa6d90SGreg Roach 450ecdbde6SGreg Roach $individual = $this->createMock(Individual::class); 460ecdbde6SGreg Roach $individual->method('getEstimatedBirthDate')->willReturn($date); 47f3fa6d90SGreg Roach 480ecdbde6SGreg Roach $census = $this->createMock(CensusInterface::class); 490ecdbde6SGreg Roach $census->method('censusDate')->willReturn('30 JUN 1832'); 50f3fa6d90SGreg Roach 51f3fa6d90SGreg Roach $column = new CensusColumnBirthMonth($census, '', ''); 52f3fa6d90SGreg Roach 53342dcecdSGreg Roach $this->assertSame('Jan', $column->generate($individual, $individual)); 54f3fa6d90SGreg Roach } 55f3fa6d90SGreg Roach} 56