xref: /webtrees/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php (revision 89f7189b61a494347591c99bdb92afb7d8b66e1b)
1323788f4SGreg Roach<?php
23976b470SGreg Roach
3323788f4SGreg Roach/**
4323788f4SGreg Roach * webtrees: online genealogy
5*89f7189bSGreg Roach * Copyright (C) 2021 webtrees development team
6323788f4SGreg Roach * This program is free software: you can redistribute it and/or modify
7323788f4SGreg Roach * it under the terms of the GNU General Public License as published by
8323788f4SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9323788f4SGreg Roach * (at your option) any later version.
10323788f4SGreg Roach * This program is distributed in the hope that it will be useful,
11323788f4SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12323788f4SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13323788f4SGreg Roach * GNU General Public License for more details.
14323788f4SGreg Roach * You should have received a copy of the GNU General Public License
15*89f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16323788f4SGreg Roach */
17fcfa147eSGreg Roach
18e7f56f2aSGreg Roachdeclare(strict_types=1);
19e7f56f2aSGreg Roach
2084e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition;
21c1010edaSGreg Roach
223cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase;
233cfcc809SGreg Roach
24323788f4SGreg Roach/**
25323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition
26323788f4SGreg Roach */
273cfcc809SGreg Roachclass IcelandicSurnameTraditionTest extends TestCase
28c1010edaSGreg Roach{
29323788f4SGreg Roach    /** @var SurnameTraditionInterface */
30323788f4SGreg Roach    private $surname_tradition;
31323788f4SGreg Roach
32323788f4SGreg Roach    /**
33323788f4SGreg Roach     * Prepare the environment for these tests
3452348eb8SGreg Roach     *
3552348eb8SGreg Roach     * @return void
36323788f4SGreg Roach     */
375c48bcd6SGreg Roach    protected function setUp(): void
38c1010edaSGreg Roach    {
390115bc16SGreg Roach        parent::setUp();
400115bc16SGreg Roach
4174d6dc0eSGreg Roach        $this->surname_tradition = new IcelandicSurnameTradition();
42323788f4SGreg Roach    }
43323788f4SGreg Roach
44323788f4SGreg Roach    /**
45323788f4SGreg Roach     * Test whether married surnames are used
4617d74f3aSGreg Roach     *
4715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
4852348eb8SGreg Roach     *
4952348eb8SGreg Roach     * @return void
50323788f4SGreg Roach     */
519b802b22SGreg Roach    public function testMarriedSurnames(): void
52c1010edaSGreg Roach    {
535e933c21SGreg Roach        self::assertFalse($this->surname_tradition->hasMarriedNames());
54323788f4SGreg Roach    }
55323788f4SGreg Roach
56323788f4SGreg Roach    /**
57c1ec7145SGreg Roach     * Test whether surnames are used
5817d74f3aSGreg Roach     *
5915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
6052348eb8SGreg Roach     *
6152348eb8SGreg Roach     * @return void
62c1ec7145SGreg Roach     */
639b802b22SGreg Roach    public function testSurnames(): void
64c1010edaSGreg Roach    {
655e933c21SGreg Roach        self::assertFalse($this->surname_tradition->hasSurnames());
66c1ec7145SGreg Roach    }
67c1ec7145SGreg Roach
68c1ec7145SGreg Roach    /**
69323788f4SGreg Roach     * Test new son names
7017d74f3aSGreg Roach     *
7115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
7252348eb8SGreg Roach     *
7352348eb8SGreg Roach     * @return void
74323788f4SGreg Roach     */
759b802b22SGreg Roach    public function testNewSonNames(): void
76c1010edaSGreg Roach    {
775e933c21SGreg Roach        self::assertSame(
7813abd6f3SGreg Roach            ['NAME' => 'Jonsson'],
79323788f4SGreg Roach            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M')
80323788f4SGreg Roach        );
81323788f4SGreg Roach    }
82323788f4SGreg Roach
83323788f4SGreg Roach    /**
84323788f4SGreg Roach     * Test new daughter names
8517d74f3aSGreg Roach     *
8615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
8752348eb8SGreg Roach     *
8852348eb8SGreg Roach     * @return void
89323788f4SGreg Roach     */
909b802b22SGreg Roach    public function testNewDaughterNames(): void
91c1010edaSGreg Roach    {
925e933c21SGreg Roach        self::assertSame(
9313abd6f3SGreg Roach            ['NAME' => 'Jonsdottir'],
94323788f4SGreg Roach            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F')
95323788f4SGreg Roach        );
96323788f4SGreg Roach    }
97323788f4SGreg Roach
98323788f4SGreg Roach    /**
99323788f4SGreg Roach     * Test new child names
10017d74f3aSGreg Roach     *
10115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
10252348eb8SGreg Roach     *
10352348eb8SGreg Roach     * @return void
104323788f4SGreg Roach     */
1059b802b22SGreg Roach    public function testNewChildNames(): void
106c1010edaSGreg Roach    {
1075e933c21SGreg Roach        self::assertSame(
10813abd6f3SGreg Roach            [],
109323788f4SGreg Roach            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U')
110323788f4SGreg Roach        );
111323788f4SGreg Roach    }
112323788f4SGreg Roach
113323788f4SGreg Roach    /**
114323788f4SGreg Roach     * Test new father names
11517d74f3aSGreg Roach     *
11615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
11752348eb8SGreg Roach     *
11852348eb8SGreg Roach     * @return void
119323788f4SGreg Roach     */
1209b802b22SGreg Roach    public function testNewFatherNames(): void
121c1010edaSGreg Roach    {
1225e933c21SGreg Roach        self::assertSame(
123c1010edaSGreg Roach            [
124c1010edaSGreg Roach                'NAME' => 'Einar',
125c1010edaSGreg Roach                'GIVN' => 'Einar',
126c1010edaSGreg Roach            ],
127323788f4SGreg Roach            $this->surname_tradition->newParentNames('Jon Einarsson', 'M')
128323788f4SGreg Roach        );
129323788f4SGreg Roach    }
130323788f4SGreg Roach
131323788f4SGreg Roach    /**
132323788f4SGreg Roach     * Test new mother names
13317d74f3aSGreg Roach     *
13415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
13552348eb8SGreg Roach     *
13652348eb8SGreg Roach     * @return void
137323788f4SGreg Roach     */
1389b802b22SGreg Roach    public function testNewMotherNames(): void
139c1010edaSGreg Roach    {
1405e933c21SGreg Roach        self::assertSame(
14113abd6f3SGreg Roach            [],
142323788f4SGreg Roach            $this->surname_tradition->newParentNames('Jon Einarsson', 'F')
143323788f4SGreg Roach        );
144323788f4SGreg Roach    }
145323788f4SGreg Roach
146323788f4SGreg Roach    /**
147323788f4SGreg Roach     * Test new parent names
14817d74f3aSGreg Roach     *
14915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
15052348eb8SGreg Roach     *
15152348eb8SGreg Roach     * @return void
152323788f4SGreg Roach     */
1539b802b22SGreg Roach    public function testNewParentNames(): void
154c1010edaSGreg Roach    {
1555e933c21SGreg Roach        self::assertSame(
15613abd6f3SGreg Roach            [],
157323788f4SGreg Roach            $this->surname_tradition->newParentNames('Jon Einarsson', 'U')
158323788f4SGreg Roach        );
159323788f4SGreg Roach    }
160323788f4SGreg Roach
161323788f4SGreg Roach    /**
162323788f4SGreg Roach     * Test new husband names
16317d74f3aSGreg Roach     *
16415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
16552348eb8SGreg Roach     *
16652348eb8SGreg Roach     * @return void
167323788f4SGreg Roach     */
1689b802b22SGreg Roach    public function testNewHusbandNames(): void
169c1010edaSGreg Roach    {
1705e933c21SGreg Roach        self::assertSame(
17113abd6f3SGreg Roach            [],
172323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M')
173323788f4SGreg Roach        );
174323788f4SGreg Roach    }
175323788f4SGreg Roach
176323788f4SGreg Roach    /**
177323788f4SGreg Roach     * Test new wife names
17817d74f3aSGreg Roach     *
17915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
18052348eb8SGreg Roach     *
18152348eb8SGreg Roach     * @return void
182323788f4SGreg Roach     */
1839b802b22SGreg Roach    public function testNewWifeNames(): void
184c1010edaSGreg Roach    {
1855e933c21SGreg Roach        self::assertSame(
18613abd6f3SGreg Roach            [],
187323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'F')
188323788f4SGreg Roach        );
189323788f4SGreg Roach    }
190323788f4SGreg Roach
191323788f4SGreg Roach    /**
192323788f4SGreg Roach     * Test new spouse names
19317d74f3aSGreg Roach     *
19415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
19552348eb8SGreg Roach     *
19652348eb8SGreg Roach     * @return void
197323788f4SGreg Roach     */
1989b802b22SGreg Roach    public function testNewSpouseNames(): void
199c1010edaSGreg Roach    {
2005e933c21SGreg Roach        self::assertSame(
20113abd6f3SGreg Roach            [],
202323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'U')
203323788f4SGreg Roach        );
204323788f4SGreg Roach    }
205323788f4SGreg Roach}
206