xref: /webtrees/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php (revision e9e853987811e8bd423dccf26f6ef57571f393eb)
1<?php
2/**
3 * webtrees: online genealogy
4 * Copyright (C) 2019 webtrees development team
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16declare(strict_types=1);
17
18namespace Fisharebest\Webtrees\SurnameTradition;
19
20/**
21 * Test harness for the class SpanishSurnameTradition
22 */
23class IcelandicSurnameTraditionTest extends \Fisharebest\Webtrees\TestCase
24{
25    /** @var SurnameTraditionInterface */
26    private $surname_tradition;
27
28    /**
29     * Prepare the environment for these tests
30     *
31     * @return void
32     */
33    protected function setUp()
34    {
35        parent::setUp();
36
37        $this->surname_tradition = new IcelandicSurnameTradition;
38    }
39
40    /**
41     * Test whether married surnames are used
42     *
43     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
44     *
45     * @return void
46     */
47    public function testMarriedSurnames(): void
48    {
49        $this->assertSame(false, $this->surname_tradition->hasMarriedNames());
50    }
51
52    /**
53     * Test whether surnames are used
54     *
55     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
56     *
57     * @return void
58     */
59    public function testSurnames(): void
60    {
61        $this->assertSame(false, $this->surname_tradition->hasSurnames());
62    }
63
64    /**
65     * Test new son names
66     *
67     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
68     *
69     * @return void
70     */
71    public function testNewSonNames(): void
72    {
73        $this->assertSame(
74            ['NAME' => 'Jonsson'],
75            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M')
76        );
77    }
78
79    /**
80     * Test new daughter names
81     *
82     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
83     *
84     * @return void
85     */
86    public function testNewDaughterNames(): void
87    {
88        $this->assertSame(
89            ['NAME' => 'Jonsdottir'],
90            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F')
91        );
92    }
93
94    /**
95     * Test new child names
96     *
97     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
98     *
99     * @return void
100     */
101    public function testNewChildNames(): void
102    {
103        $this->assertSame(
104            [],
105            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U')
106        );
107    }
108
109    /**
110     * Test new father names
111     *
112     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
113     *
114     * @return void
115     */
116    public function testNewFatherNames(): void
117    {
118        $this->assertSame(
119            [
120                'NAME' => 'Einar',
121                'GIVN' => 'Einar',
122            ],
123            $this->surname_tradition->newParentNames('Jon Einarsson', 'M')
124        );
125    }
126
127    /**
128     * Test new mother names
129     *
130     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
131     *
132     * @return void
133     */
134    public function testNewMotherNames(): void
135    {
136        $this->assertSame(
137            [],
138            $this->surname_tradition->newParentNames('Jon Einarsson', 'F')
139        );
140    }
141
142    /**
143     * Test new parent names
144     *
145     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
146     *
147     * @return void
148     */
149    public function testNewParentNames(): void
150    {
151        $this->assertSame(
152            [],
153            $this->surname_tradition->newParentNames('Jon Einarsson', 'U')
154        );
155    }
156
157    /**
158     * Test new husband names
159     *
160     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
161     *
162     * @return void
163     */
164    public function testNewHusbandNames(): void
165    {
166        $this->assertSame(
167            [],
168            $this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M')
169        );
170    }
171
172    /**
173     * Test new wife names
174     *
175     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
176     *
177     * @return void
178     */
179    public function testNewWifeNames(): void
180    {
181        $this->assertSame(
182            [],
183            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'F')
184        );
185    }
186
187    /**
188     * Test new spouse names
189     *
190     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
191     *
192     * @return void
193     */
194    public function testNewSpouseNames(): void
195    {
196        $this->assertSame(
197            [],
198            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'U')
199        );
200    }
201}
202