xref: /webtrees/tests/app/Census/CensusOfRhodeIslandTest.php (revision 5a8afed46297e8105e3e5a33ce37e6a8e88bc79d)
16de2fb6bSKirk Gartside<?php
26de2fb6bSKirk Gartside
36de2fb6bSKirk Gartside/**
46de2fb6bSKirk Gartside * webtrees: online genealogy
5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
66de2fb6bSKirk Gartside * This program is free software: you can redistribute it and/or modify
76de2fb6bSKirk Gartside * it under the terms of the GNU General Public License as published by
86de2fb6bSKirk Gartside * the Free Software Foundation, either version 3 of the License, or
96de2fb6bSKirk Gartside * (at your option) any later version.
106de2fb6bSKirk Gartside * This program is distributed in the hope that it will be useful,
116de2fb6bSKirk Gartside * but WITHOUT ANY WARRANTY; without even the implied warranty of
126de2fb6bSKirk Gartside * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
136de2fb6bSKirk Gartside * GNU General Public License for more details.
146de2fb6bSKirk Gartside * You should have received a copy of the GNU General Public License
156de2fb6bSKirk Gartside * along with this program. If not, see <https://www.gnu.org/licenses/>.
166de2fb6bSKirk Gartside */
176de2fb6bSKirk Gartside
186de2fb6bSKirk Gartsidedeclare(strict_types=1);
196de2fb6bSKirk Gartside
206de2fb6bSKirk Gartsidenamespace Fisharebest\Webtrees\Census;
216de2fb6bSKirk Gartside
226de2fb6bSKirk Gartsideuse Fisharebest\Webtrees\TestCase;
23*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass;
246de2fb6bSKirk Gartside
25*202c018bSGreg Roach#[CoversClass(CensusOfRhodeIsland::class)]
266de2fb6bSKirk Gartsideclass CensusOfRhodeIslandTest extends TestCase
276de2fb6bSKirk Gartside{
286de2fb6bSKirk Gartside    /**
296de2fb6bSKirk Gartside     * Test the census place
306de2fb6bSKirk Gartside     */
316de2fb6bSKirk Gartside    public function testPlace(): void
326de2fb6bSKirk Gartside    {
336de2fb6bSKirk Gartside        $census = new CensusOfRhodeIsland();
346de2fb6bSKirk Gartside
356de2fb6bSKirk Gartside        self::assertSame('Rhode Island, United States', $census->censusPlace());
366de2fb6bSKirk Gartside    }
376de2fb6bSKirk Gartside
386de2fb6bSKirk Gartside    /**
396de2fb6bSKirk Gartside     * Test the census language
406de2fb6bSKirk Gartside     */
416de2fb6bSKirk Gartside    public function testLanguage(): void
426de2fb6bSKirk Gartside    {
436de2fb6bSKirk Gartside        $census = new CensusOfRhodeIsland();
446de2fb6bSKirk Gartside
456de2fb6bSKirk Gartside        self::assertSame('en-US', $census->censusLanguage());
466de2fb6bSKirk Gartside    }
476de2fb6bSKirk Gartside
486de2fb6bSKirk Gartside    /**
496de2fb6bSKirk Gartside     * Test the census dates
506de2fb6bSKirk Gartside     */
516de2fb6bSKirk Gartside    public function testAllDates(): void
526de2fb6bSKirk Gartside    {
536de2fb6bSKirk Gartside        $census = new CensusOfRhodeIsland();
546de2fb6bSKirk Gartside
556de2fb6bSKirk Gartside        $census_dates = $census->allCensusDates();
566de2fb6bSKirk Gartside
576de2fb6bSKirk Gartside        self::assertCount(3, $census_dates);
586de2fb6bSKirk Gartside        self::assertInstanceOf(CensusOfRhodeIsland1905::class, $census_dates[0]);
596de2fb6bSKirk Gartside        self::assertInstanceOf(CensusOfRhodeIsland1915::class, $census_dates[1]);
606de2fb6bSKirk Gartside        self::assertInstanceOf(CensusOfRhodeIsland1925::class, $census_dates[2]);
616de2fb6bSKirk Gartside    }
626de2fb6bSKirk Gartside}
63