xref: /webtrees/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php (revision 0115bc1678cafd957052cd2d256563ad3e242cc1)
1323788f4SGreg Roach<?php
2323788f4SGreg Roach/**
3323788f4SGreg Roach * webtrees: online genealogy
41062a142SGreg Roach * Copyright (C) 2018 webtrees development team
5323788f4SGreg Roach * This program is free software: you can redistribute it and/or modify
6323788f4SGreg Roach * it under the terms of the GNU General Public License as published by
7323788f4SGreg Roach * the Free Software Foundation, either version 3 of the License, or
8323788f4SGreg Roach * (at your option) any later version.
9323788f4SGreg Roach * This program is distributed in the hope that it will be useful,
10323788f4SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
11323788f4SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12323788f4SGreg Roach * GNU General Public License for more details.
13323788f4SGreg Roach * You should have received a copy of the GNU General Public License
14323788f4SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
15323788f4SGreg Roach */
16e7f56f2aSGreg Roachdeclare(strict_types=1);
17e7f56f2aSGreg Roach
1884e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition;
19c1010edaSGreg Roach
20323788f4SGreg Roach/**
21323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition
22323788f4SGreg Roach */
2384e2cf4eSGreg Roachclass IcelandicSurnameTraditionTest extends \Fisharebest\Webtrees\TestCase
24c1010edaSGreg Roach{
25323788f4SGreg Roach    /** @var SurnameTraditionInterface */
26323788f4SGreg Roach    private $surname_tradition;
27323788f4SGreg Roach
28323788f4SGreg Roach    /**
29323788f4SGreg Roach     * Prepare the environment for these tests
3052348eb8SGreg Roach     *
3152348eb8SGreg Roach     * @return void
32323788f4SGreg Roach     */
33*0115bc16SGreg Roach    protected function setUp()
34c1010edaSGreg Roach    {
35*0115bc16SGreg Roach        parent::setUp();
36*0115bc16SGreg Roach
37323788f4SGreg Roach        $this->surname_tradition = new IcelandicSurnameTradition;
38323788f4SGreg Roach    }
39323788f4SGreg Roach
40323788f4SGreg Roach    /**
41323788f4SGreg Roach     * Test whether married surnames are used
4217d74f3aSGreg Roach     *
4315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
4452348eb8SGreg Roach     *
4552348eb8SGreg Roach     * @return void
46323788f4SGreg Roach     */
47c1010edaSGreg Roach    public function testMarriedSurnames()
48c1010edaSGreg Roach    {
49323788f4SGreg Roach        $this->assertSame(false, $this->surname_tradition->hasMarriedNames());
50323788f4SGreg Roach    }
51323788f4SGreg Roach
52323788f4SGreg Roach    /**
53c1ec7145SGreg Roach     * Test whether surnames are used
5417d74f3aSGreg Roach     *
5515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
5652348eb8SGreg Roach     *
5752348eb8SGreg Roach     * @return void
58c1ec7145SGreg Roach     */
59c1010edaSGreg Roach    public function testSurnames()
60c1010edaSGreg Roach    {
61c1ec7145SGreg Roach        $this->assertSame(false, $this->surname_tradition->hasSurnames());
62c1ec7145SGreg Roach    }
63c1ec7145SGreg Roach
64c1ec7145SGreg Roach    /**
65323788f4SGreg Roach     * Test new son names
6617d74f3aSGreg Roach     *
6715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
6852348eb8SGreg Roach     *
6952348eb8SGreg Roach     * @return void
70323788f4SGreg Roach     */
71c1010edaSGreg Roach    public function testNewSonNames()
72c1010edaSGreg Roach    {
73323788f4SGreg Roach        $this->assertSame(
7413abd6f3SGreg Roach            ['NAME' => 'Jonsson'],
75323788f4SGreg Roach            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M')
76323788f4SGreg Roach        );
77323788f4SGreg Roach    }
78323788f4SGreg Roach
79323788f4SGreg Roach    /**
80323788f4SGreg Roach     * Test new daughter names
8117d74f3aSGreg Roach     *
8215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
8352348eb8SGreg Roach     *
8452348eb8SGreg Roach     * @return void
85323788f4SGreg Roach     */
86c1010edaSGreg Roach    public function testNewDaughterNames()
87c1010edaSGreg Roach    {
88323788f4SGreg Roach        $this->assertSame(
8913abd6f3SGreg Roach            ['NAME' => 'Jonsdottir'],
90323788f4SGreg Roach            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F')
91323788f4SGreg Roach        );
92323788f4SGreg Roach    }
93323788f4SGreg Roach
94323788f4SGreg Roach    /**
95323788f4SGreg Roach     * Test new child names
9617d74f3aSGreg Roach     *
9715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
9852348eb8SGreg Roach     *
9952348eb8SGreg Roach     * @return void
100323788f4SGreg Roach     */
101c1010edaSGreg Roach    public function testNewChildNames()
102c1010edaSGreg Roach    {
103323788f4SGreg Roach        $this->assertSame(
10413abd6f3SGreg Roach            [],
105323788f4SGreg Roach            $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U')
106323788f4SGreg Roach        );
107323788f4SGreg Roach    }
108323788f4SGreg Roach
109323788f4SGreg Roach    /**
110323788f4SGreg Roach     * Test new father names
11117d74f3aSGreg Roach     *
11215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
11352348eb8SGreg Roach     *
11452348eb8SGreg Roach     * @return void
115323788f4SGreg Roach     */
116c1010edaSGreg Roach    public function testNewFatherNames()
117c1010edaSGreg Roach    {
118323788f4SGreg Roach        $this->assertSame(
119c1010edaSGreg Roach            [
120c1010edaSGreg Roach                'NAME' => 'Einar',
121c1010edaSGreg Roach                'GIVN' => 'Einar',
122c1010edaSGreg Roach            ],
123323788f4SGreg Roach            $this->surname_tradition->newParentNames('Jon Einarsson', 'M')
124323788f4SGreg Roach        );
125323788f4SGreg Roach    }
126323788f4SGreg Roach
127323788f4SGreg Roach    /**
128323788f4SGreg Roach     * Test new mother names
12917d74f3aSGreg Roach     *
13015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
13152348eb8SGreg Roach     *
13252348eb8SGreg Roach     * @return void
133323788f4SGreg Roach     */
134c1010edaSGreg Roach    public function testNewMotherNames()
135c1010edaSGreg Roach    {
136323788f4SGreg Roach        $this->assertSame(
13713abd6f3SGreg Roach            [],
138323788f4SGreg Roach            $this->surname_tradition->newParentNames('Jon Einarsson', 'F')
139323788f4SGreg Roach        );
140323788f4SGreg Roach    }
141323788f4SGreg Roach
142323788f4SGreg Roach    /**
143323788f4SGreg Roach     * Test new parent names
14417d74f3aSGreg Roach     *
14515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
14652348eb8SGreg Roach     *
14752348eb8SGreg Roach     * @return void
148323788f4SGreg Roach     */
149c1010edaSGreg Roach    public function testNewParentNames()
150c1010edaSGreg Roach    {
151323788f4SGreg Roach        $this->assertSame(
15213abd6f3SGreg Roach            [],
153323788f4SGreg Roach            $this->surname_tradition->newParentNames('Jon Einarsson', 'U')
154323788f4SGreg Roach        );
155323788f4SGreg Roach    }
156323788f4SGreg Roach
157323788f4SGreg Roach    /**
158323788f4SGreg Roach     * Test new husband names
15917d74f3aSGreg Roach     *
16015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
16152348eb8SGreg Roach     *
16252348eb8SGreg Roach     * @return void
163323788f4SGreg Roach     */
164c1010edaSGreg Roach    public function testNewHusbandNames()
165c1010edaSGreg Roach    {
166323788f4SGreg Roach        $this->assertSame(
16713abd6f3SGreg Roach            [],
168323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M')
169323788f4SGreg Roach        );
170323788f4SGreg Roach    }
171323788f4SGreg Roach
172323788f4SGreg Roach    /**
173323788f4SGreg Roach     * Test new wife names
17417d74f3aSGreg Roach     *
17515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
17652348eb8SGreg Roach     *
17752348eb8SGreg Roach     * @return void
178323788f4SGreg Roach     */
179c1010edaSGreg Roach    public function testNewWifeNames()
180c1010edaSGreg Roach    {
181323788f4SGreg Roach        $this->assertSame(
18213abd6f3SGreg Roach            [],
183323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'F')
184323788f4SGreg Roach        );
185323788f4SGreg Roach    }
186323788f4SGreg Roach
187323788f4SGreg Roach    /**
188323788f4SGreg Roach     * Test new spouse names
18917d74f3aSGreg Roach     *
19015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition
19152348eb8SGreg Roach     *
19252348eb8SGreg Roach     * @return void
193323788f4SGreg Roach     */
194c1010edaSGreg Roach    public function testNewSpouseNames()
195c1010edaSGreg Roach    {
196323788f4SGreg Roach        $this->assertSame(
19713abd6f3SGreg Roach            [],
198323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Jon Einarsson', 'U')
199323788f4SGreg Roach        );
200323788f4SGreg Roach    }
201323788f4SGreg Roach}
202