xref: /webtrees/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php (revision 9b802b22a7b94d1d30e0433dd46fe641f3757505)
1323788f4SGreg Roach<?php
2323788f4SGreg Roach/**
3323788f4SGreg Roach * webtrees: online genealogy
48fcd0d32SGreg Roach * Copyright (C) 2019 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 LithuanianSurnameTraditionTest 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     */
330115bc16SGreg Roach    protected function setUp()
34c1010edaSGreg Roach    {
350115bc16SGreg Roach        parent::setUp();
360115bc16SGreg Roach
37323788f4SGreg Roach        $this->surname_tradition = new LithuanianSurnameTradition;
38323788f4SGreg Roach    }
39323788f4SGreg Roach
40323788f4SGreg Roach    /**
41323788f4SGreg Roach     * Test whether married surnames are used
4217d74f3aSGreg Roach     *
4315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
4415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
4552348eb8SGreg Roach     *
4652348eb8SGreg Roach     * @return void
47323788f4SGreg Roach     */
48*9b802b22SGreg Roach    public function testMarriedSurnames(): void
49c1010edaSGreg Roach    {
50323788f4SGreg Roach        $this->assertSame(true, $this->surname_tradition->hasMarriedNames());
51323788f4SGreg Roach    }
52323788f4SGreg Roach
53323788f4SGreg Roach    /**
54c1ec7145SGreg Roach     * Test whether surnames are used
5517d74f3aSGreg Roach     *
5615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
5715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
5852348eb8SGreg Roach     *
5952348eb8SGreg Roach     * @return void
60c1ec7145SGreg Roach     */
61*9b802b22SGreg Roach    public function testSurnames(): void
62c1010edaSGreg Roach    {
63c1ec7145SGreg Roach        $this->assertSame(true, $this->surname_tradition->hasSurnames());
64c1ec7145SGreg Roach    }
65c1ec7145SGreg Roach
66c1ec7145SGreg Roach    /**
67323788f4SGreg Roach     * Test new son names
6817d74f3aSGreg Roach     *
6915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
7015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
7152348eb8SGreg Roach     *
7252348eb8SGreg Roach     * @return void
73323788f4SGreg Roach     */
74*9b802b22SGreg Roach    public function testNewSonNames(): void
75c1010edaSGreg Roach    {
76323788f4SGreg Roach        $this->assertSame(
77c1010edaSGreg Roach            [
78c1010edaSGreg Roach                'NAME' => '/White/',
79c1010edaSGreg Roach                'SURN' => 'White',
80c1010edaSGreg Roach            ],
81323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M')
82323788f4SGreg Roach        );
83323788f4SGreg Roach    }
84323788f4SGreg Roach
85323788f4SGreg Roach    /**
86323788f4SGreg Roach     * Test new daughter names
8717d74f3aSGreg Roach     *
8815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
8915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
9052348eb8SGreg Roach     *
9152348eb8SGreg Roach     * @return void
92323788f4SGreg Roach     */
93*9b802b22SGreg Roach    public function testNewDaughterNames(): void
94c1010edaSGreg Roach    {
95323788f4SGreg Roach        $this->assertSame(
96c1010edaSGreg Roach            [
97c1010edaSGreg Roach                'NAME' => '/White/',
98c1010edaSGreg Roach                'SURN' => 'White',
99c1010edaSGreg Roach            ],
100323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F')
101323788f4SGreg Roach        );
102323788f4SGreg Roach    }
103323788f4SGreg Roach
104323788f4SGreg Roach    /**
105323788f4SGreg Roach     * Test new daughter names
10617d74f3aSGreg Roach     *
10715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
10815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
10952348eb8SGreg Roach     *
11052348eb8SGreg Roach     * @return void
111323788f4SGreg Roach     */
112*9b802b22SGreg Roach    public function testNewDaughterNamesInflected(): void
113c1010edaSGreg Roach    {
114323788f4SGreg Roach        $this->assertSame(
115c1010edaSGreg Roach            [
116c1010edaSGreg Roach                'NAME' => '/Whitaitė/',
117c1010edaSGreg Roach                'SURN' => 'Whita',
118c1010edaSGreg Roach            ],
119323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F')
120323788f4SGreg Roach        );
121323788f4SGreg Roach        $this->assertSame(
122c1010edaSGreg Roach            [
123c1010edaSGreg Roach                'NAME' => '/Whitaitė/',
124c1010edaSGreg Roach                'SURN' => 'Whitas',
125c1010edaSGreg Roach            ],
126323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F')
127323788f4SGreg Roach        );
128323788f4SGreg Roach        $this->assertSame(
129c1010edaSGreg Roach            [
130c1010edaSGreg Roach                'NAME' => '/Whitytė/',
131c1010edaSGreg Roach                'SURN' => 'Whitis',
132c1010edaSGreg Roach            ],
133323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F')
134323788f4SGreg Roach        );
135323788f4SGreg Roach        $this->assertSame(
136c1010edaSGreg Roach            [
137c1010edaSGreg Roach                'NAME' => '/Whitytė/',
138c1010edaSGreg Roach                'SURN' => 'Whitys',
139c1010edaSGreg Roach            ],
140323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F')
141323788f4SGreg Roach        );
142323788f4SGreg Roach        $this->assertSame(
143c1010edaSGreg Roach            [
144c1010edaSGreg Roach                'NAME' => '/Whitiūtė/',
145c1010edaSGreg Roach                'SURN' => 'Whitius',
146c1010edaSGreg Roach            ],
147323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F')
148323788f4SGreg Roach        );
149323788f4SGreg Roach        $this->assertSame(
150c1010edaSGreg Roach            [
151c1010edaSGreg Roach                'NAME' => '/Whitutė/',
152c1010edaSGreg Roach                'SURN' => 'Whitus',
153c1010edaSGreg Roach            ],
154323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F')
155323788f4SGreg Roach        );
156323788f4SGreg Roach    }
157323788f4SGreg Roach
158323788f4SGreg Roach    /**
159323788f4SGreg Roach     * Test new child names
16017d74f3aSGreg Roach     *
16115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
16215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
16352348eb8SGreg Roach     *
16452348eb8SGreg Roach     * @return void
165323788f4SGreg Roach     */
166*9b802b22SGreg Roach    public function testNewChildNames(): void
167c1010edaSGreg Roach    {
168323788f4SGreg Roach        $this->assertSame(
169c1010edaSGreg Roach            [
170c1010edaSGreg Roach                'NAME' => '/White/',
171c1010edaSGreg Roach                'SURN' => 'White',
172c1010edaSGreg Roach            ],
173323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U')
174323788f4SGreg Roach        );
175323788f4SGreg Roach    }
176323788f4SGreg Roach
177323788f4SGreg Roach    /**
1781677a03aSGreg Roach     * Test new child names
17917d74f3aSGreg Roach     *
18015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
18115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
18252348eb8SGreg Roach     *
18352348eb8SGreg Roach     * @return void
1841677a03aSGreg Roach     */
185*9b802b22SGreg Roach    public function testNewChildNamesWithNoParentsNames(): void
186c1010edaSGreg Roach    {
1871677a03aSGreg Roach        $this->assertSame(
18813abd6f3SGreg Roach            ['NAME' => '//'],
1891677a03aSGreg Roach            $this->surname_tradition->newChildNames('', '', 'U')
1901677a03aSGreg Roach        );
1911677a03aSGreg Roach    }
1921677a03aSGreg Roach
1931677a03aSGreg Roach    /**
194323788f4SGreg Roach     * Test new father names
19517d74f3aSGreg Roach     *
19615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
19715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
19852348eb8SGreg Roach     *
19952348eb8SGreg Roach     * @return void
200323788f4SGreg Roach     */
201*9b802b22SGreg Roach    public function testNewFatherNames(): void
202c1010edaSGreg Roach    {
203323788f4SGreg Roach        $this->assertSame(
204c1010edaSGreg Roach            [
205c1010edaSGreg Roach                'NAME' => '/White/',
206c1010edaSGreg Roach                'SURN' => 'White',
207c1010edaSGreg Roach            ],
208323788f4SGreg Roach            $this->surname_tradition->newParentNames('John /White/', 'M')
209323788f4SGreg Roach        );
210323788f4SGreg Roach    }
211323788f4SGreg Roach
212323788f4SGreg Roach    /**
213323788f4SGreg Roach     * Test new father names
21417d74f3aSGreg Roach     *
21515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
21615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
21752348eb8SGreg Roach     *
21852348eb8SGreg Roach     * @return void
219323788f4SGreg Roach     */
220*9b802b22SGreg Roach    public function testNewFatherNamesInflected(): void
221c1010edaSGreg Roach    {
222323788f4SGreg Roach        $this->assertSame(
223c1010edaSGreg Roach            [
224c1010edaSGreg Roach                'NAME' => '/Whitas/',
225c1010edaSGreg Roach                'SURN' => 'Whitas',
226c1010edaSGreg Roach            ],
227323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M')
228323788f4SGreg Roach        );
229323788f4SGreg Roach        $this->assertSame(
230c1010edaSGreg Roach            [
231c1010edaSGreg Roach                'NAME' => '/Whitis/',
232c1010edaSGreg Roach                'SURN' => 'Whitis',
233c1010edaSGreg Roach            ],
234323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitytė/', 'M')
235323788f4SGreg Roach        );
236323788f4SGreg Roach        $this->assertSame(
237c1010edaSGreg Roach            [
238c1010edaSGreg Roach                'NAME' => '/Whitius/',
239c1010edaSGreg Roach                'SURN' => 'Whitius',
240c1010edaSGreg Roach            ],
241323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M')
242323788f4SGreg Roach        );
243323788f4SGreg Roach        $this->assertSame(
244c1010edaSGreg Roach            [
245c1010edaSGreg Roach                'NAME' => '/Whitus/',
246c1010edaSGreg Roach                'SURN' => 'Whitus',
247c1010edaSGreg Roach            ],
248323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitutė/', 'M')
249323788f4SGreg Roach        );
250323788f4SGreg Roach    }
251323788f4SGreg Roach
252323788f4SGreg Roach    /**
253323788f4SGreg Roach     * Test new mother names
25417d74f3aSGreg Roach     *
25515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
25615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
25752348eb8SGreg Roach     *
25852348eb8SGreg Roach     * @return void
259323788f4SGreg Roach     */
260*9b802b22SGreg Roach    public function testNewMotherNames(): void
261c1010edaSGreg Roach    {
262323788f4SGreg Roach        $this->assertSame(
26313abd6f3SGreg Roach            ['NAME' => '//'],
264323788f4SGreg Roach            $this->surname_tradition->newParentNames('John /White/', 'F')
265323788f4SGreg Roach        );
266323788f4SGreg Roach    }
267323788f4SGreg Roach
268323788f4SGreg Roach    /**
269323788f4SGreg Roach     * Test new parent names
27017d74f3aSGreg Roach     *
27115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
27215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
27352348eb8SGreg Roach     *
27452348eb8SGreg Roach     * @return void
275323788f4SGreg Roach     */
276*9b802b22SGreg Roach    public function testNewParentNames(): void
277c1010edaSGreg Roach    {
278323788f4SGreg Roach        $this->assertSame(
27913abd6f3SGreg Roach            ['NAME' => '//'],
280323788f4SGreg Roach            $this->surname_tradition->newParentNames('John /White/', 'U')
281323788f4SGreg Roach        );
282323788f4SGreg Roach    }
283323788f4SGreg Roach
284323788f4SGreg Roach    /**
285323788f4SGreg Roach     * Test new husband names
28617d74f3aSGreg Roach     *
28715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
28815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
28952348eb8SGreg Roach     *
29052348eb8SGreg Roach     * @return void
291323788f4SGreg Roach     */
292*9b802b22SGreg Roach    public function testNewHusbandNames(): void
293c1010edaSGreg Roach    {
294323788f4SGreg Roach        $this->assertSame(
29513abd6f3SGreg Roach            ['NAME' => '//'],
296323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Mary /Black/', 'M')
297323788f4SGreg Roach        );
298323788f4SGreg Roach    }
299323788f4SGreg Roach
300323788f4SGreg Roach    /**
301323788f4SGreg Roach     * Test new wife names
30217d74f3aSGreg Roach     *
30315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
30415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
30552348eb8SGreg Roach     *
30652348eb8SGreg Roach     * @return void
307323788f4SGreg Roach     */
308*9b802b22SGreg Roach    public function testNewWifeNames(): void
309c1010edaSGreg Roach    {
310323788f4SGreg Roach        $this->assertSame(
311c1010edaSGreg Roach            [
312c1010edaSGreg Roach                'NAME'   => '//',
313c1010edaSGreg Roach                '_MARNM' => '/White/',
314c1010edaSGreg Roach            ],
315323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('John /White/', 'F')
316323788f4SGreg Roach        );
317323788f4SGreg Roach    }
318323788f4SGreg Roach
319323788f4SGreg Roach    /**
320323788f4SGreg Roach     * Test new spouse names
32117d74f3aSGreg Roach     *
32215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
32315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
32452348eb8SGreg Roach     *
32552348eb8SGreg Roach     * @return void
326323788f4SGreg Roach     */
327*9b802b22SGreg Roach    public function testNewSpouseNames(): void
328c1010edaSGreg Roach    {
329323788f4SGreg Roach        $this->assertSame(
33013abd6f3SGreg Roach            ['NAME' => '//'],
331323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Chris /Green/', 'U')
332323788f4SGreg Roach        );
333323788f4SGreg Roach    }
334323788f4SGreg Roach}
335