xref: /webtrees/tests/app/Census/CensusColumnBirthMonthTest.php (revision 0ecdbde6aab590acff4665ec491a8427f5b7c90e)
1f3fa6d90SGreg Roach<?php
2f3fa6d90SGreg Roach/**
3f3fa6d90SGreg Roach * webtrees: online genealogy
48fcd0d32SGreg Roach * Copyright (C) 2019 webtrees development team
5f3fa6d90SGreg Roach * This program is free software: you can redistribute it and/or modify
6f3fa6d90SGreg Roach * it under the terms of the GNU General Public License as published by
7f3fa6d90SGreg Roach * the Free Software Foundation, either version 3 of the License, or
8f3fa6d90SGreg Roach * (at your option) any later version.
9f3fa6d90SGreg Roach * This program is distributed in the hope that it will be useful,
10f3fa6d90SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
11f3fa6d90SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12f3fa6d90SGreg Roach * GNU General Public License for more details.
13f3fa6d90SGreg Roach * You should have received a copy of the GNU General Public License
14f3fa6d90SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
15f3fa6d90SGreg Roach */
16e7f56f2aSGreg Roachdeclare(strict_types=1);
17e7f56f2aSGreg Roach
18f3fa6d90SGreg Roachnamespace Fisharebest\Webtrees\Census;
19f3fa6d90SGreg Roach
20ddf438a5SGreg Roachuse Fisharebest\Webtrees\Date;
21ddf438a5SGreg Roachuse Fisharebest\Webtrees\Date\GregorianDate;
22ddf438a5SGreg Roachuse Fisharebest\Webtrees\Individual;
23f3fa6d90SGreg Roach
24f3fa6d90SGreg Roach/**
25f3fa6d90SGreg Roach * Test harness for the class CensusColumnAge
26f3fa6d90SGreg Roach */
2784e2cf4eSGreg Roachclass CensusColumnBirthMonthTest extends \Fisharebest\Webtrees\TestCase
28c1010edaSGreg Roach{
29f3fa6d90SGreg Roach    /**
3015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusColumnBirthMonth
3115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
3252348eb8SGreg Roach     *
3352348eb8SGreg Roach     * @return void
34f3fa6d90SGreg Roach     */
359b802b22SGreg Roach    public function testGenerateColumn(): void
36c1010edaSGreg Roach    {
37*0ecdbde6SGreg Roach        $cal_date = $this->createMock(GregorianDate::class);
38*0ecdbde6SGreg Roach        $cal_date->method('format')->willReturn('Jan');
39f3fa6d90SGreg Roach
40*0ecdbde6SGreg Roach        $date = $this->createMock(Date::class);
41*0ecdbde6SGreg Roach        $date->method('minimumDate')->willReturn($cal_date);
42f3fa6d90SGreg Roach
43*0ecdbde6SGreg Roach        $individual = $this->createMock(Individual::class);
44*0ecdbde6SGreg Roach        $individual->method('getEstimatedBirthDate')->willReturn($date);
45f3fa6d90SGreg Roach
46*0ecdbde6SGreg Roach        $census = $this->createMock(CensusInterface::class);
47*0ecdbde6SGreg Roach        $census->method('censusDate')->willReturn('30 JUN 1832');
48f3fa6d90SGreg Roach
49f3fa6d90SGreg Roach        $column = new CensusColumnBirthMonth($census, '', '');
50f3fa6d90SGreg Roach
51342dcecdSGreg Roach        $this->assertSame('Jan', $column->generate($individual, $individual));
52f3fa6d90SGreg Roach    }
53f3fa6d90SGreg Roach}
54