xref: /webtrees/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php (revision c1010eda29c0909ed4d5d463f32d32bfefdd4dfe)
1323788f4SGreg Roach<?php
2323788f4SGreg Roach
3323788f4SGreg Roach/**
4323788f4SGreg Roach * webtrees: online genealogy
51062a142SGreg Roach * Copyright (C) 2018 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 */
17*c1010edaSGreg Roach
18323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition;
19323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface;
20323788f4SGreg Roach
21323788f4SGreg Roach/**
22323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition
23323788f4SGreg Roach */
24*c1010edaSGreg Roachclass LithuanianSurnameTraditionTest extends \PHPUnit\Framework\TestCase
25*c1010edaSGreg Roach{
26323788f4SGreg Roach    /** @var SurnameTraditionInterface */
27323788f4SGreg Roach    private $surname_tradition;
28323788f4SGreg Roach
29323788f4SGreg Roach    /**
30323788f4SGreg Roach     * Prepare the environment for these tests
31323788f4SGreg Roach     */
32*c1010edaSGreg Roach    public function setUp()
33*c1010edaSGreg Roach    {
34323788f4SGreg Roach        $this->surname_tradition = new LithuanianSurnameTradition;
35323788f4SGreg Roach    }
36323788f4SGreg Roach
37323788f4SGreg Roach    /**
38323788f4SGreg Roach     * Test whether married surnames are used
3917d74f3aSGreg Roach     *
4015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
4115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
42323788f4SGreg Roach     */
43*c1010edaSGreg Roach    public function testMarriedSurnames()
44*c1010edaSGreg Roach    {
45323788f4SGreg Roach        $this->assertSame(true, $this->surname_tradition->hasMarriedNames());
46323788f4SGreg Roach    }
47323788f4SGreg Roach
48323788f4SGreg Roach    /**
49c1ec7145SGreg Roach     * Test whether surnames are used
5017d74f3aSGreg Roach     *
5115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
5215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
53c1ec7145SGreg Roach     */
54*c1010edaSGreg Roach    public function testSurnames()
55*c1010edaSGreg Roach    {
56c1ec7145SGreg Roach        $this->assertSame(true, $this->surname_tradition->hasSurnames());
57c1ec7145SGreg Roach    }
58c1ec7145SGreg Roach
59c1ec7145SGreg Roach    /**
60323788f4SGreg Roach     * Test new son names
6117d74f3aSGreg Roach     *
6215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
6315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
64323788f4SGreg Roach     */
65*c1010edaSGreg Roach    public function testNewSonNames()
66*c1010edaSGreg Roach    {
67323788f4SGreg Roach        $this->assertSame(
68*c1010edaSGreg Roach            [
69*c1010edaSGreg Roach                'NAME' => '/White/',
70*c1010edaSGreg Roach                'SURN' => 'White',
71*c1010edaSGreg Roach            ],
72323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M')
73323788f4SGreg Roach        );
74323788f4SGreg Roach    }
75323788f4SGreg Roach
76323788f4SGreg Roach    /**
77323788f4SGreg Roach     * Test new daughter names
7817d74f3aSGreg Roach     *
7915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
8015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
81323788f4SGreg Roach     */
82*c1010edaSGreg Roach    public function testNewDaughterNames()
83*c1010edaSGreg Roach    {
84323788f4SGreg Roach        $this->assertSame(
85*c1010edaSGreg Roach            [
86*c1010edaSGreg Roach                'NAME' => '/White/',
87*c1010edaSGreg Roach                'SURN' => 'White',
88*c1010edaSGreg Roach            ],
89323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F')
90323788f4SGreg Roach        );
91323788f4SGreg Roach    }
92323788f4SGreg Roach
93323788f4SGreg Roach    /**
94323788f4SGreg Roach     * Test new daughter names
9517d74f3aSGreg Roach     *
9615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
9715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
98323788f4SGreg Roach     */
99*c1010edaSGreg Roach    public function testNewDaughterNamesInflected()
100*c1010edaSGreg Roach    {
101323788f4SGreg Roach        $this->assertSame(
102*c1010edaSGreg Roach            [
103*c1010edaSGreg Roach                'NAME' => '/Whitaitė/',
104*c1010edaSGreg Roach                'SURN' => 'Whita',
105*c1010edaSGreg Roach            ],
106323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F')
107323788f4SGreg Roach        );
108323788f4SGreg Roach        $this->assertSame(
109*c1010edaSGreg Roach            [
110*c1010edaSGreg Roach                'NAME' => '/Whitaitė/',
111*c1010edaSGreg Roach                'SURN' => 'Whitas',
112*c1010edaSGreg Roach            ],
113323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F')
114323788f4SGreg Roach        );
115323788f4SGreg Roach        $this->assertSame(
116*c1010edaSGreg Roach            [
117*c1010edaSGreg Roach                'NAME' => '/Whitytė/',
118*c1010edaSGreg Roach                'SURN' => 'Whitis',
119*c1010edaSGreg Roach            ],
120323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F')
121323788f4SGreg Roach        );
122323788f4SGreg Roach        $this->assertSame(
123*c1010edaSGreg Roach            [
124*c1010edaSGreg Roach                'NAME' => '/Whitytė/',
125*c1010edaSGreg Roach                'SURN' => 'Whitys',
126*c1010edaSGreg Roach            ],
127323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F')
128323788f4SGreg Roach        );
129323788f4SGreg Roach        $this->assertSame(
130*c1010edaSGreg Roach            [
131*c1010edaSGreg Roach                'NAME' => '/Whitiūtė/',
132*c1010edaSGreg Roach                'SURN' => 'Whitius',
133*c1010edaSGreg Roach            ],
134323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F')
135323788f4SGreg Roach        );
136323788f4SGreg Roach        $this->assertSame(
137*c1010edaSGreg Roach            [
138*c1010edaSGreg Roach                'NAME' => '/Whitutė/',
139*c1010edaSGreg Roach                'SURN' => 'Whitus',
140*c1010edaSGreg Roach            ],
141323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F')
142323788f4SGreg Roach        );
143323788f4SGreg Roach    }
144323788f4SGreg Roach
145323788f4SGreg Roach    /**
146323788f4SGreg Roach     * Test new child names
14717d74f3aSGreg Roach     *
14815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
14915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
150323788f4SGreg Roach     */
151*c1010edaSGreg Roach    public function testNewChildNames()
152*c1010edaSGreg Roach    {
153323788f4SGreg Roach        $this->assertSame(
154*c1010edaSGreg Roach            [
155*c1010edaSGreg Roach                'NAME' => '/White/',
156*c1010edaSGreg Roach                'SURN' => 'White',
157*c1010edaSGreg Roach            ],
158323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U')
159323788f4SGreg Roach        );
160323788f4SGreg Roach    }
161323788f4SGreg Roach
162323788f4SGreg Roach    /**
1631677a03aSGreg Roach     * Test new child names
16417d74f3aSGreg Roach     *
16515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
16615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
1671677a03aSGreg Roach     */
168*c1010edaSGreg Roach    public function testNewChildNamesWithNoParentsNames()
169*c1010edaSGreg Roach    {
1701677a03aSGreg Roach        $this->assertSame(
17113abd6f3SGreg Roach            ['NAME' => '//'],
1721677a03aSGreg Roach            $this->surname_tradition->newChildNames('', '', 'U')
1731677a03aSGreg Roach        );
1741677a03aSGreg Roach    }
1751677a03aSGreg Roach
1761677a03aSGreg Roach    /**
177323788f4SGreg Roach     * Test new father names
17817d74f3aSGreg Roach     *
17915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
18015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
181323788f4SGreg Roach     */
182*c1010edaSGreg Roach    public function testNewFatherNames()
183*c1010edaSGreg Roach    {
184323788f4SGreg Roach        $this->assertSame(
185*c1010edaSGreg Roach            [
186*c1010edaSGreg Roach                'NAME' => '/White/',
187*c1010edaSGreg Roach                'SURN' => 'White',
188*c1010edaSGreg Roach            ],
189323788f4SGreg Roach            $this->surname_tradition->newParentNames('John /White/', 'M')
190323788f4SGreg Roach        );
191323788f4SGreg Roach    }
192323788f4SGreg Roach
193323788f4SGreg Roach    /**
194323788f4SGreg Roach     * Test new father names
19517d74f3aSGreg Roach     *
19615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
19715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
198323788f4SGreg Roach     */
199*c1010edaSGreg Roach    public function testNewFatherNamesInflected()
200*c1010edaSGreg Roach    {
201323788f4SGreg Roach        $this->assertSame(
202*c1010edaSGreg Roach            [
203*c1010edaSGreg Roach                'NAME' => '/Whitas/',
204*c1010edaSGreg Roach                'SURN' => 'Whitas',
205*c1010edaSGreg Roach            ],
206323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M')
207323788f4SGreg Roach        );
208323788f4SGreg Roach        $this->assertSame(
209*c1010edaSGreg Roach            [
210*c1010edaSGreg Roach                'NAME' => '/Whitis/',
211*c1010edaSGreg Roach                'SURN' => 'Whitis',
212*c1010edaSGreg Roach            ],
213323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitytė/', 'M')
214323788f4SGreg Roach        );
215323788f4SGreg Roach        $this->assertSame(
216*c1010edaSGreg Roach            [
217*c1010edaSGreg Roach                'NAME' => '/Whitius/',
218*c1010edaSGreg Roach                'SURN' => 'Whitius',
219*c1010edaSGreg Roach            ],
220323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M')
221323788f4SGreg Roach        );
222323788f4SGreg Roach        $this->assertSame(
223*c1010edaSGreg Roach            [
224*c1010edaSGreg Roach                'NAME' => '/Whitus/',
225*c1010edaSGreg Roach                'SURN' => 'Whitus',
226*c1010edaSGreg Roach            ],
227323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitutė/', 'M')
228323788f4SGreg Roach        );
229323788f4SGreg Roach    }
230323788f4SGreg Roach
231323788f4SGreg Roach    /**
232323788f4SGreg Roach     * Test new mother names
23317d74f3aSGreg Roach     *
23415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
23515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
236323788f4SGreg Roach     */
237*c1010edaSGreg Roach    public function testNewMotherNames()
238*c1010edaSGreg Roach    {
239323788f4SGreg Roach        $this->assertSame(
24013abd6f3SGreg Roach            ['NAME' => '//'],
241323788f4SGreg Roach            $this->surname_tradition->newParentNames('John /White/', 'F')
242323788f4SGreg Roach        );
243323788f4SGreg Roach    }
244323788f4SGreg Roach
245323788f4SGreg Roach    /**
246323788f4SGreg Roach     * Test new parent names
24717d74f3aSGreg Roach     *
24815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
24915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
250323788f4SGreg Roach     */
251*c1010edaSGreg Roach    public function testNewParentNames()
252*c1010edaSGreg Roach    {
253323788f4SGreg Roach        $this->assertSame(
25413abd6f3SGreg Roach            ['NAME' => '//'],
255323788f4SGreg Roach            $this->surname_tradition->newParentNames('John /White/', 'U')
256323788f4SGreg Roach        );
257323788f4SGreg Roach    }
258323788f4SGreg Roach
259323788f4SGreg Roach    /**
260323788f4SGreg Roach     * Test new husband names
26117d74f3aSGreg Roach     *
26215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
26315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
264323788f4SGreg Roach     */
265*c1010edaSGreg Roach    public function testNewHusbandNames()
266*c1010edaSGreg Roach    {
267323788f4SGreg Roach        $this->assertSame(
26813abd6f3SGreg Roach            ['NAME' => '//'],
269323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Mary /Black/', 'M')
270323788f4SGreg Roach        );
271323788f4SGreg Roach    }
272323788f4SGreg Roach
273323788f4SGreg Roach    /**
274323788f4SGreg Roach     * Test new wife names
27517d74f3aSGreg Roach     *
27615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
27715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
278323788f4SGreg Roach     */
279*c1010edaSGreg Roach    public function testNewWifeNames()
280*c1010edaSGreg Roach    {
281323788f4SGreg Roach        $this->assertSame(
282*c1010edaSGreg Roach            [
283*c1010edaSGreg Roach                'NAME'   => '//',
284*c1010edaSGreg Roach                '_MARNM' => '/White/',
285*c1010edaSGreg Roach            ],
286323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('John /White/', 'F')
287323788f4SGreg Roach        );
288323788f4SGreg Roach    }
289323788f4SGreg Roach
290323788f4SGreg Roach    /**
291323788f4SGreg Roach     * Test new spouse names
29217d74f3aSGreg Roach     *
29315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
29415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
295323788f4SGreg Roach     */
296*c1010edaSGreg Roach    public function testNewSpouseNames()
297*c1010edaSGreg Roach    {
298323788f4SGreg Roach        $this->assertSame(
29913abd6f3SGreg Roach            ['NAME' => '//'],
300323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Chris /Green/', 'U')
301323788f4SGreg Roach        );
302323788f4SGreg Roach    }
303323788f4SGreg Roach}
304