xref: /webtrees/tests/app/Census/CensusColumnBirthDaySlashMonthYearTest.php (revision 0ecdbde6aab590acff4665ec491a8427f5b7c90e)
14c219c47SGreg Roach<?php
24c219c47SGreg Roach/**
34c219c47SGreg Roach * webtrees: online genealogy
48fcd0d32SGreg Roach * Copyright (C) 2019 webtrees development team
54c219c47SGreg Roach * This program is free software: you can redistribute it and/or modify
64c219c47SGreg Roach * it under the terms of the GNU General Public License as published by
74c219c47SGreg Roach * the Free Software Foundation, either version 3 of the License, or
84c219c47SGreg Roach * (at your option) any later version.
94c219c47SGreg Roach * This program is distributed in the hope that it will be useful,
104c219c47SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
114c219c47SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
124c219c47SGreg Roach * GNU General Public License for more details.
134c219c47SGreg Roach * You should have received a copy of the GNU General Public License
144c219c47SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
154c219c47SGreg Roach */
16e7f56f2aSGreg Roachdeclare(strict_types=1);
17e7f56f2aSGreg Roach
184c219c47SGreg Roachnamespace Fisharebest\Webtrees\Census;
194c219c47SGreg Roach
20ddf438a5SGreg Roachuse Fisharebest\Webtrees\Date;
21ddf438a5SGreg Roachuse Fisharebest\Webtrees\Date\GregorianDate;
22ddf438a5SGreg Roachuse Fisharebest\Webtrees\Individual;
234c219c47SGreg Roach
244c219c47SGreg Roach/**
254c219c47SGreg Roach * Test harness for the class CensusColumnBirthDaySlashMonthYearTest
264c219c47SGreg Roach */
2784e2cf4eSGreg Roachclass CensusColumnBirthDaySlashMonthYearTest extends \Fisharebest\Webtrees\TestCase
28c1010edaSGreg Roach{
294c219c47SGreg Roach    /**
3015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusColumnBirthDaySlashMonthYearTest
3115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
3252348eb8SGreg Roach     *
3352348eb8SGreg Roach     * @return void
344c219c47SGreg 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('30/6 1832');
394c219c47SGreg Roach
40*0ecdbde6SGreg Roach        $date = $this->createMock(Date::class);
41*0ecdbde6SGreg Roach        $date->method('minimumJulianDay')->willReturn(2390364);
42*0ecdbde6SGreg Roach        $date->method('maximumJulianDay')->willReturn(2390364);
43*0ecdbde6SGreg Roach        $date->method('minimumDate')->willReturn($cal_date);
444c219c47SGreg Roach
45*0ecdbde6SGreg Roach        $individual = $this->createMock(Individual::class);
46*0ecdbde6SGreg Roach        $individual->method('getBirthDate')->willReturn($date);
474c219c47SGreg Roach
48*0ecdbde6SGreg Roach        $census = $this->createMock(CensusInterface::class);
49*0ecdbde6SGreg Roach        $census->method('censusDate')->willReturn('30 JUN 1832');
504c219c47SGreg Roach
514c219c47SGreg Roach        $column = new CensusColumnBirthDaySlashMonthYear($census, '', '');
524c219c47SGreg Roach
53342dcecdSGreg Roach        $this->assertSame('30/6 1832', $column->generate($individual, $individual));
544c219c47SGreg Roach    }
554c219c47SGreg Roach}
56