xref: /webtrees/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php (revision 3976b4703df669696105ed6b024b96d433c8fbdb)
1323788f4SGreg Roach<?php
2*3976b470SGreg Roach
3323788f4SGreg Roach/**
4323788f4SGreg Roach * webtrees: online genealogy
58fcd0d32SGreg Roach * Copyright (C) 2019 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
15323788f4SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
16323788f4SGreg Roach */
17e7f56f2aSGreg Roachdeclare(strict_types=1);
18e7f56f2aSGreg Roach
1984e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition;
20c1010edaSGreg Roach
21323788f4SGreg Roach/**
22323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition
23323788f4SGreg Roach */
2484e2cf4eSGreg Roachclass IcelandicSurnameTraditionTest extends \Fisharebest\Webtrees\TestCase
25c1010edaSGreg Roach{
26323788f4SGreg Roach    /** @var SurnameTraditionInterface */
27323788f4SGreg Roach    private $surname_tradition;
28323788f4SGreg Roach
29323788f4SGreg Roach    /**
30323788f4SGreg Roach     * Prepare the environment for these tests
3152348eb8SGreg Roach     *
3252348eb8SGreg Roach     * @return void
33323788f4SGreg Roach     */
345c48bcd6SGreg Roach    protected function setUp(): void
35c1010edaSGreg Roach    {
360115bc16SGreg Roach        parent::setUp();
370115bc16SGreg Roach
3874d6dc0eSGreg Roach        $this->surname_tradition = new IcelandicSurnameTradition();
39323788f4SGreg Roach    }
40323788f4SGreg Roach
41323788f4SGreg Roach    /**
42323788f4SGreg Roach     * Test whether married surnames are used
4317d74f3aSGreg Roach     *
4415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
4552348eb8SGreg Roach     *
4652348eb8SGreg Roach     * @return void
47323788f4SGreg Roach     */
489b802b22SGreg Roach    public function testMarriedSurnames(): void
49c1010edaSGreg Roach    {
50a32e6421SGreg Roach        $this->assertFalse($this->surname_tradition->hasMarriedNames());
51323788f4SGreg Roach    }
52323788f4SGreg Roach
53323788f4SGreg Roach    /**
54c1ec7145SGreg Roach     * Test whether surnames are used
5517d74f3aSGreg Roach     *
5615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
5752348eb8SGreg Roach     *
5852348eb8SGreg Roach     * @return void
59c1ec7145SGreg Roach     */
609b802b22SGreg Roach    public function testSurnames(): void
61c1010edaSGreg Roach    {
62a32e6421SGreg Roach        $this->assertFalse($this->surname_tradition->hasSurnames());
63c1ec7145SGreg Roach    }
64c1ec7145SGreg Roach
65c1ec7145SGreg Roach    /**
66323788f4SGreg Roach     * Test new son names
6717d74f3aSGreg Roach     *
6815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
6952348eb8SGreg Roach     *
7052348eb8SGreg Roach     * @return void
71323788f4SGreg Roach     */
729b802b22SGreg Roach    public function testNewSonNames(): void
73c1010edaSGreg Roach    {
74323788f4SGreg Roach        $this->assertSame(
7513abd6f3SGreg Roach            ['NAME' => 'Jonsson'],
76323788f4SGreg Roach            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M')
77323788f4SGreg Roach        );
78323788f4SGreg Roach    }
79323788f4SGreg Roach
80323788f4SGreg Roach    /**
81323788f4SGreg Roach     * Test new daughter names
8217d74f3aSGreg Roach     *
8315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
8452348eb8SGreg Roach     *
8552348eb8SGreg Roach     * @return void
86323788f4SGreg Roach     */
879b802b22SGreg Roach    public function testNewDaughterNames(): void
88c1010edaSGreg Roach    {
89323788f4SGreg Roach        $this->assertSame(
9013abd6f3SGreg Roach            ['NAME' => 'Jonsdottir'],
91323788f4SGreg Roach            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F')
92323788f4SGreg Roach        );
93323788f4SGreg Roach    }
94323788f4SGreg Roach
95323788f4SGreg Roach    /**
96323788f4SGreg Roach     * Test new child names
9717d74f3aSGreg Roach     *
9815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
9952348eb8SGreg Roach     *
10052348eb8SGreg Roach     * @return void
101323788f4SGreg Roach     */
1029b802b22SGreg Roach    public function testNewChildNames(): void
103c1010edaSGreg Roach    {
104323788f4SGreg Roach        $this->assertSame(
10513abd6f3SGreg Roach            [],
106323788f4SGreg Roach            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U')
107323788f4SGreg Roach        );
108323788f4SGreg Roach    }
109323788f4SGreg Roach
110323788f4SGreg Roach    /**
111323788f4SGreg Roach     * Test new father names
11217d74f3aSGreg Roach     *
11315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
11452348eb8SGreg Roach     *
11552348eb8SGreg Roach     * @return void
116323788f4SGreg Roach     */
1179b802b22SGreg Roach    public function testNewFatherNames(): void
118c1010edaSGreg Roach    {
119323788f4SGreg Roach        $this->assertSame(
120c1010edaSGreg Roach            [
121c1010edaSGreg Roach                'NAME' => 'Einar',
122c1010edaSGreg Roach                'GIVN' => 'Einar',
123c1010edaSGreg Roach            ],
124323788f4SGreg Roach            $this->surname_tradition->newParentNames('Jon Einarsson', 'M')
125323788f4SGreg Roach        );
126323788f4SGreg Roach    }
127323788f4SGreg Roach
128323788f4SGreg Roach    /**
129323788f4SGreg Roach     * Test new mother names
13017d74f3aSGreg Roach     *
13115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
13252348eb8SGreg Roach     *
13352348eb8SGreg Roach     * @return void
134323788f4SGreg Roach     */
1359b802b22SGreg Roach    public function testNewMotherNames(): void
136c1010edaSGreg Roach    {
137323788f4SGreg Roach        $this->assertSame(
13813abd6f3SGreg Roach            [],
139323788f4SGreg Roach            $this->surname_tradition->newParentNames('Jon Einarsson', 'F')
140323788f4SGreg Roach        );
141323788f4SGreg Roach    }
142323788f4SGreg Roach
143323788f4SGreg Roach    /**
144323788f4SGreg Roach     * Test new parent names
14517d74f3aSGreg Roach     *
14615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
14752348eb8SGreg Roach     *
14852348eb8SGreg Roach     * @return void
149323788f4SGreg Roach     */
1509b802b22SGreg Roach    public function testNewParentNames(): void
151c1010edaSGreg Roach    {
152323788f4SGreg Roach        $this->assertSame(
15313abd6f3SGreg Roach            [],
154323788f4SGreg Roach            $this->surname_tradition->newParentNames('Jon Einarsson', 'U')
155323788f4SGreg Roach        );
156323788f4SGreg Roach    }
157323788f4SGreg Roach
158323788f4SGreg Roach    /**
159323788f4SGreg Roach     * Test new husband names
16017d74f3aSGreg Roach     *
16115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
16252348eb8SGreg Roach     *
16352348eb8SGreg Roach     * @return void
164323788f4SGreg Roach     */
1659b802b22SGreg Roach    public function testNewHusbandNames(): void
166c1010edaSGreg Roach    {
167323788f4SGreg Roach        $this->assertSame(
16813abd6f3SGreg Roach            [],
169323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M')
170323788f4SGreg Roach        );
171323788f4SGreg Roach    }
172323788f4SGreg Roach
173323788f4SGreg Roach    /**
174323788f4SGreg Roach     * Test new wife names
17517d74f3aSGreg Roach     *
17615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
17752348eb8SGreg Roach     *
17852348eb8SGreg Roach     * @return void
179323788f4SGreg Roach     */
1809b802b22SGreg Roach    public function testNewWifeNames(): void
181c1010edaSGreg Roach    {
182323788f4SGreg Roach        $this->assertSame(
18313abd6f3SGreg Roach            [],
184323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'F')
185323788f4SGreg Roach        );
186323788f4SGreg Roach    }
187323788f4SGreg Roach
188323788f4SGreg Roach    /**
189323788f4SGreg Roach     * Test new spouse names
19017d74f3aSGreg Roach     *
19115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
19252348eb8SGreg Roach     *
19352348eb8SGreg Roach     * @return void
194323788f4SGreg Roach     */
1959b802b22SGreg Roach    public function testNewSpouseNames(): void
196c1010edaSGreg Roach    {
197323788f4SGreg Roach        $this->assertSame(
19813abd6f3SGreg Roach            [],
199323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'U')
200323788f4SGreg Roach        );
201323788f4SGreg Roach    }
202323788f4SGreg Roach}
203