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