xref: /webtrees/tests/app/Census/CensusColumnBirthDaySlashMonthYearTest.php (revision 3976b4703df669696105ed6b024b96d433c8fbdb)
14c219c47SGreg Roach<?php
2*3976b470SGreg Roach
34c219c47SGreg Roach/**
44c219c47SGreg Roach * webtrees: online genealogy
58fcd0d32SGreg Roach * Copyright (C) 2019 webtrees development team
64c219c47SGreg Roach * This program is free software: you can redistribute it and/or modify
74c219c47SGreg Roach * it under the terms of the GNU General Public License as published by
84c219c47SGreg Roach * the Free Software Foundation, either version 3 of the License, or
94c219c47SGreg Roach * (at your option) any later version.
104c219c47SGreg Roach * This program is distributed in the hope that it will be useful,
114c219c47SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
124c219c47SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
134c219c47SGreg Roach * GNU General Public License for more details.
144c219c47SGreg Roach * You should have received a copy of the GNU General Public License
154c219c47SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
164c219c47SGreg Roach */
17e7f56f2aSGreg Roachdeclare(strict_types=1);
18e7f56f2aSGreg Roach
194c219c47SGreg Roachnamespace Fisharebest\Webtrees\Census;
204c219c47SGreg Roach
21ddf438a5SGreg Roachuse Fisharebest\Webtrees\Date;
22ddf438a5SGreg Roachuse Fisharebest\Webtrees\Date\GregorianDate;
23ddf438a5SGreg Roachuse Fisharebest\Webtrees\Individual;
244c219c47SGreg Roach
254c219c47SGreg Roach/**
264c219c47SGreg Roach * Test harness for the class CensusColumnBirthDaySlashMonthYearTest
274c219c47SGreg Roach */
2884e2cf4eSGreg Roachclass CensusColumnBirthDaySlashMonthYearTest extends \Fisharebest\Webtrees\TestCase
29c1010edaSGreg Roach{
304c219c47SGreg Roach    /**
3115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\CensusColumnBirthDaySlashMonthYearTest
3215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
3352348eb8SGreg Roach     *
3452348eb8SGreg Roach     * @return void
354c219c47SGreg Roach     */
369b802b22SGreg Roach    public function testGenerateColumn(): void
37c1010edaSGreg Roach    {
380ecdbde6SGreg Roach        $cal_date = $this->createMock(GregorianDate::class);
390ecdbde6SGreg Roach        $cal_date->method('format')->willReturn('30/6 1832');
404c219c47SGreg Roach
410ecdbde6SGreg Roach        $date = $this->createMock(Date::class);
420ecdbde6SGreg Roach        $date->method('minimumJulianDay')->willReturn(2390364);
430ecdbde6SGreg Roach        $date->method('maximumJulianDay')->willReturn(2390364);
440ecdbde6SGreg Roach        $date->method('minimumDate')->willReturn($cal_date);
454c219c47SGreg Roach
460ecdbde6SGreg Roach        $individual = $this->createMock(Individual::class);
470ecdbde6SGreg Roach        $individual->method('getBirthDate')->willReturn($date);
484c219c47SGreg Roach
490ecdbde6SGreg Roach        $census = $this->createMock(CensusInterface::class);
500ecdbde6SGreg Roach        $census->method('censusDate')->willReturn('30 JUN 1832');
514c219c47SGreg Roach
524c219c47SGreg Roach        $column = new CensusColumnBirthDaySlashMonthYear($census, '', '');
534c219c47SGreg Roach
54342dcecdSGreg Roach        $this->assertSame('30/6 1832', $column->generate($individual, $individual));
554c219c47SGreg Roach    }
564c219c47SGreg Roach}
57