xref: /webtrees/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php (revision 67994fb087e1b24564a780e4ae8aeff801733e35)
1<?php
2/**
3 * webtrees: online genealogy
4 * Copyright (C) 2018 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
20use Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition;
21use Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface;
22
23/**
24 * Test harness for the class SpanishSurnameTradition
25 */
26class IcelandicSurnameTraditionTest extends \Fisharebest\Webtrees\TestCase
27{
28    /** @var SurnameTraditionInterface */
29    private $surname_tradition;
30
31    /**
32     * Prepare the environment for these tests
33     *
34     * @return void
35     */
36    public function setUp()
37    {
38        $this->surname_tradition = new IcelandicSurnameTradition;
39    }
40
41    /**
42     * Test whether married surnames are used
43     *
44     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
45     *
46     * @return void
47     */
48    public function testMarriedSurnames()
49    {
50        $this->assertSame(false, $this->surname_tradition->hasMarriedNames());
51    }
52
53    /**
54     * Test whether surnames are used
55     *
56     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
57     *
58     * @return void
59     */
60    public function testSurnames()
61    {
62        $this->assertSame(false, $this->surname_tradition->hasSurnames());
63    }
64
65    /**
66     * Test new son names
67     *
68     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
69     *
70     * @return void
71     */
72    public function testNewSonNames()
73    {
74        $this->assertSame(
75            ['NAME' => 'Jonsson'],
76            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M')
77        );
78    }
79
80    /**
81     * Test new daughter names
82     *
83     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
84     *
85     * @return void
86     */
87    public function testNewDaughterNames()
88    {
89        $this->assertSame(
90            ['NAME' => 'Jonsdottir'],
91            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F')
92        );
93    }
94
95    /**
96     * Test new child names
97     *
98     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
99     *
100     * @return void
101     */
102    public function testNewChildNames()
103    {
104        $this->assertSame(
105            [],
106            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U')
107        );
108    }
109
110    /**
111     * Test new father names
112     *
113     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
114     *
115     * @return void
116     */
117    public function testNewFatherNames()
118    {
119        $this->assertSame(
120            [
121                'NAME' => 'Einar',
122                'GIVN' => 'Einar',
123            ],
124            $this->surname_tradition->newParentNames('Jon Einarsson', 'M')
125        );
126    }
127
128    /**
129     * Test new mother names
130     *
131     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
132     *
133     * @return void
134     */
135    public function testNewMotherNames()
136    {
137        $this->assertSame(
138            [],
139            $this->surname_tradition->newParentNames('Jon Einarsson', 'F')
140        );
141    }
142
143    /**
144     * Test new parent names
145     *
146     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
147     *
148     * @return void
149     */
150    public function testNewParentNames()
151    {
152        $this->assertSame(
153            [],
154            $this->surname_tradition->newParentNames('Jon Einarsson', 'U')
155        );
156    }
157
158    /**
159     * Test new husband names
160     *
161     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
162     *
163     * @return void
164     */
165    public function testNewHusbandNames()
166    {
167        $this->assertSame(
168            [],
169            $this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M')
170        );
171    }
172
173    /**
174     * Test new wife names
175     *
176     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
177     *
178     * @return void
179     */
180    public function testNewWifeNames()
181    {
182        $this->assertSame(
183            [],
184            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'F')
185        );
186    }
187
188    /**
189     * Test new spouse names
190     *
191     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
192     *
193     * @return void
194     */
195    public function testNewSpouseNames()
196    {
197        $this->assertSame(
198            [],
199            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'U')
200        );
201    }
202}
203