xref: /webtrees/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php (revision c4943cff72f95a28fbb9404e3c20b169ff098e5c)
1323788f4SGreg Roach<?php
23976b470SGreg Roach
3323788f4SGreg Roach/**
4323788f4SGreg Roach * webtrees: online genealogy
589f7189bSGreg Roach * Copyright (C) 2021 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
1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
16323788f4SGreg Roach */
17fcfa147eSGreg Roach
18e7f56f2aSGreg Roachdeclare(strict_types=1);
19e7f56f2aSGreg Roach
2084e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition;
21c1010edaSGreg Roach
223cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase;
233cfcc809SGreg Roach
24323788f4SGreg Roach/**
25*c4943cffSGreg Roach * Test harness for the class LithuanianSurnameTraditionTest
26323788f4SGreg Roach */
273cfcc809SGreg Roachclass LithuanianSurnameTraditionTest extends TestCase
28c1010edaSGreg Roach{
29*c4943cffSGreg Roach    private SurnameTraditionInterface $surname_tradition;
30323788f4SGreg Roach
31323788f4SGreg Roach    /**
32323788f4SGreg Roach     * Prepare the environment for these tests
3352348eb8SGreg Roach     *
3452348eb8SGreg Roach     * @return void
35323788f4SGreg Roach     */
365c48bcd6SGreg Roach    protected function setUp(): void
37c1010edaSGreg Roach    {
380115bc16SGreg Roach        parent::setUp();
390115bc16SGreg Roach
4074d6dc0eSGreg Roach        $this->surname_tradition = new LithuanianSurnameTradition();
41323788f4SGreg Roach    }
42323788f4SGreg Roach
43323788f4SGreg Roach    /**
44323788f4SGreg Roach     * Test whether married surnames are used
4517d74f3aSGreg Roach     *
4615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
4715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
4852348eb8SGreg Roach     *
4952348eb8SGreg Roach     * @return void
50323788f4SGreg Roach     */
519b802b22SGreg Roach    public function testMarriedSurnames(): void
52c1010edaSGreg Roach    {
535e933c21SGreg Roach        self::assertTrue($this->surname_tradition->hasMarriedNames());
54323788f4SGreg Roach    }
55323788f4SGreg Roach
56323788f4SGreg Roach    /**
57c1ec7145SGreg Roach     * Test whether surnames are used
5817d74f3aSGreg Roach     *
5915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
6015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
6152348eb8SGreg Roach     *
6252348eb8SGreg Roach     * @return void
63c1ec7145SGreg Roach     */
649b802b22SGreg Roach    public function testSurnames(): void
65c1010edaSGreg Roach    {
665e933c21SGreg Roach        self::assertTrue($this->surname_tradition->hasSurnames());
67c1ec7145SGreg Roach    }
68c1ec7145SGreg Roach
69c1ec7145SGreg Roach    /**
70323788f4SGreg Roach     * Test new son names
7117d74f3aSGreg Roach     *
7215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
7315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
7452348eb8SGreg Roach     *
7552348eb8SGreg Roach     * @return void
76323788f4SGreg Roach     */
779b802b22SGreg Roach    public function testNewSonNames(): void
78c1010edaSGreg Roach    {
795e933c21SGreg Roach        self::assertSame(
80c1010edaSGreg Roach            [
81c1010edaSGreg Roach                'NAME' => '/White/',
82c1010edaSGreg Roach                'SURN' => 'White',
83c1010edaSGreg Roach            ],
84323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M')
85323788f4SGreg Roach        );
86323788f4SGreg Roach    }
87323788f4SGreg Roach
88323788f4SGreg Roach    /**
89323788f4SGreg Roach     * Test new daughter names
9017d74f3aSGreg Roach     *
9115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
9215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
9352348eb8SGreg Roach     *
9452348eb8SGreg Roach     * @return void
95323788f4SGreg Roach     */
969b802b22SGreg Roach    public function testNewDaughterNames(): void
97c1010edaSGreg Roach    {
985e933c21SGreg Roach        self::assertSame(
99c1010edaSGreg Roach            [
100c1010edaSGreg Roach                'NAME' => '/White/',
101c1010edaSGreg Roach                'SURN' => 'White',
102c1010edaSGreg Roach            ],
103323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F')
104323788f4SGreg Roach        );
105323788f4SGreg Roach    }
106323788f4SGreg Roach
107323788f4SGreg Roach    /**
108323788f4SGreg Roach     * Test new daughter names
10917d74f3aSGreg Roach     *
11015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
11115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
11252348eb8SGreg Roach     *
11352348eb8SGreg Roach     * @return void
114323788f4SGreg Roach     */
1159b802b22SGreg Roach    public function testNewDaughterNamesInflected(): void
116c1010edaSGreg Roach    {
1175e933c21SGreg Roach        self::assertSame(
118c1010edaSGreg Roach            [
119c1010edaSGreg Roach                'NAME' => '/Whitaitė/',
120c1010edaSGreg Roach                'SURN' => 'Whita',
121c1010edaSGreg Roach            ],
122323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F')
123323788f4SGreg Roach        );
1245e933c21SGreg Roach        self::assertSame(
125c1010edaSGreg Roach            [
126c1010edaSGreg Roach                'NAME' => '/Whitaitė/',
127c1010edaSGreg Roach                'SURN' => 'Whitas',
128c1010edaSGreg Roach            ],
129323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F')
130323788f4SGreg Roach        );
1315e933c21SGreg Roach        self::assertSame(
132c1010edaSGreg Roach            [
133c1010edaSGreg Roach                'NAME' => '/Whitytė/',
134c1010edaSGreg Roach                'SURN' => 'Whitis',
135c1010edaSGreg Roach            ],
136323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F')
137323788f4SGreg Roach        );
1385e933c21SGreg Roach        self::assertSame(
139c1010edaSGreg Roach            [
140c1010edaSGreg Roach                'NAME' => '/Whitytė/',
141c1010edaSGreg Roach                'SURN' => 'Whitys',
142c1010edaSGreg Roach            ],
143323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F')
144323788f4SGreg Roach        );
1455e933c21SGreg Roach        self::assertSame(
146c1010edaSGreg Roach            [
147c1010edaSGreg Roach                'NAME' => '/Whitiūtė/',
148c1010edaSGreg Roach                'SURN' => 'Whitius',
149c1010edaSGreg Roach            ],
150323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F')
151323788f4SGreg Roach        );
1525e933c21SGreg Roach        self::assertSame(
153c1010edaSGreg Roach            [
154c1010edaSGreg Roach                'NAME' => '/Whitutė/',
155c1010edaSGreg Roach                'SURN' => 'Whitus',
156c1010edaSGreg Roach            ],
157323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F')
158323788f4SGreg Roach        );
159323788f4SGreg Roach    }
160323788f4SGreg Roach
161323788f4SGreg Roach    /**
162323788f4SGreg Roach     * Test new child names
16317d74f3aSGreg Roach     *
16415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
16515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
16652348eb8SGreg Roach     *
16752348eb8SGreg Roach     * @return void
168323788f4SGreg Roach     */
1699b802b22SGreg Roach    public function testNewChildNames(): void
170c1010edaSGreg Roach    {
1715e933c21SGreg Roach        self::assertSame(
172c1010edaSGreg Roach            [
173c1010edaSGreg Roach                'NAME' => '/White/',
174c1010edaSGreg Roach                'SURN' => 'White',
175c1010edaSGreg Roach            ],
176323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U')
177323788f4SGreg Roach        );
178323788f4SGreg Roach    }
179323788f4SGreg Roach
180323788f4SGreg Roach    /**
1811677a03aSGreg Roach     * Test new child names
18217d74f3aSGreg Roach     *
18315d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
18415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
18552348eb8SGreg Roach     *
18652348eb8SGreg Roach     * @return void
1871677a03aSGreg Roach     */
1889b802b22SGreg Roach    public function testNewChildNamesWithNoParentsNames(): void
189c1010edaSGreg Roach    {
1905e933c21SGreg Roach        self::assertSame(
19113abd6f3SGreg Roach            ['NAME' => '//'],
1921677a03aSGreg Roach            $this->surname_tradition->newChildNames('', '', 'U')
1931677a03aSGreg Roach        );
1941677a03aSGreg Roach    }
1951677a03aSGreg Roach
1961677a03aSGreg Roach    /**
197323788f4SGreg Roach     * Test new father names
19817d74f3aSGreg Roach     *
19915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
20015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
20152348eb8SGreg Roach     *
20252348eb8SGreg Roach     * @return void
203323788f4SGreg Roach     */
2049b802b22SGreg Roach    public function testNewFatherNames(): void
205c1010edaSGreg Roach    {
2065e933c21SGreg Roach        self::assertSame(
207c1010edaSGreg Roach            [
208c1010edaSGreg Roach                'NAME' => '/White/',
209c1010edaSGreg Roach                'SURN' => 'White',
210c1010edaSGreg Roach            ],
211323788f4SGreg Roach            $this->surname_tradition->newParentNames('John /White/', 'M')
212323788f4SGreg Roach        );
213323788f4SGreg Roach    }
214323788f4SGreg Roach
215323788f4SGreg Roach    /**
216323788f4SGreg Roach     * Test new father names
21717d74f3aSGreg Roach     *
21815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
21915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
22052348eb8SGreg Roach     *
22152348eb8SGreg Roach     * @return void
222323788f4SGreg Roach     */
2239b802b22SGreg Roach    public function testNewFatherNamesInflected(): void
224c1010edaSGreg Roach    {
2255e933c21SGreg Roach        self::assertSame(
226c1010edaSGreg Roach            [
227c1010edaSGreg Roach                'NAME' => '/Whitas/',
228c1010edaSGreg Roach                'SURN' => 'Whitas',
229c1010edaSGreg Roach            ],
230323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M')
231323788f4SGreg Roach        );
2325e933c21SGreg Roach        self::assertSame(
233c1010edaSGreg Roach            [
234c1010edaSGreg Roach                'NAME' => '/Whitis/',
235c1010edaSGreg Roach                'SURN' => 'Whitis',
236c1010edaSGreg Roach            ],
237323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitytė/', 'M')
238323788f4SGreg Roach        );
2395e933c21SGreg Roach        self::assertSame(
240c1010edaSGreg Roach            [
241c1010edaSGreg Roach                'NAME' => '/Whitius/',
242c1010edaSGreg Roach                'SURN' => 'Whitius',
243c1010edaSGreg Roach            ],
244323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M')
245323788f4SGreg Roach        );
2465e933c21SGreg Roach        self::assertSame(
247c1010edaSGreg Roach            [
248c1010edaSGreg Roach                'NAME' => '/Whitus/',
249c1010edaSGreg Roach                'SURN' => 'Whitus',
250c1010edaSGreg Roach            ],
251323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitutė/', 'M')
252323788f4SGreg Roach        );
253323788f4SGreg Roach    }
254323788f4SGreg Roach
255323788f4SGreg Roach    /**
256323788f4SGreg Roach     * Test new mother names
25717d74f3aSGreg Roach     *
25815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
25915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
26052348eb8SGreg Roach     *
26152348eb8SGreg Roach     * @return void
262323788f4SGreg Roach     */
2639b802b22SGreg Roach    public function testNewMotherNames(): void
264c1010edaSGreg Roach    {
2655e933c21SGreg Roach        self::assertSame(
26613abd6f3SGreg Roach            ['NAME' => '//'],
267323788f4SGreg Roach            $this->surname_tradition->newParentNames('John /White/', 'F')
268323788f4SGreg Roach        );
269323788f4SGreg Roach    }
270323788f4SGreg Roach
271323788f4SGreg Roach    /**
272323788f4SGreg Roach     * Test new parent names
27317d74f3aSGreg Roach     *
27415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
27515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
27652348eb8SGreg Roach     *
27752348eb8SGreg Roach     * @return void
278323788f4SGreg Roach     */
2799b802b22SGreg Roach    public function testNewParentNames(): void
280c1010edaSGreg Roach    {
2815e933c21SGreg Roach        self::assertSame(
28213abd6f3SGreg Roach            ['NAME' => '//'],
283323788f4SGreg Roach            $this->surname_tradition->newParentNames('John /White/', 'U')
284323788f4SGreg Roach        );
285323788f4SGreg Roach    }
286323788f4SGreg Roach
287323788f4SGreg Roach    /**
288323788f4SGreg Roach     * Test new husband names
28917d74f3aSGreg Roach     *
29015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
29115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
29252348eb8SGreg Roach     *
29352348eb8SGreg Roach     * @return void
294323788f4SGreg Roach     */
2959b802b22SGreg Roach    public function testNewHusbandNames(): void
296c1010edaSGreg Roach    {
2975e933c21SGreg Roach        self::assertSame(
29813abd6f3SGreg Roach            ['NAME' => '//'],
299323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Mary /Black/', 'M')
300323788f4SGreg Roach        );
301323788f4SGreg Roach    }
302323788f4SGreg Roach
303323788f4SGreg Roach    /**
304323788f4SGreg Roach     * Test new wife names
30517d74f3aSGreg Roach     *
30615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
30715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
30852348eb8SGreg Roach     *
30952348eb8SGreg Roach     * @return void
310323788f4SGreg Roach     */
3119b802b22SGreg Roach    public function testNewWifeNames(): void
312c1010edaSGreg Roach    {
3135e933c21SGreg Roach        self::assertSame(
314c1010edaSGreg Roach            [
315c1010edaSGreg Roach                'NAME'   => '//',
316c1010edaSGreg Roach                '_MARNM' => '/White/',
317c1010edaSGreg Roach            ],
318323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('John /White/', 'F')
319323788f4SGreg Roach        );
320323788f4SGreg Roach    }
321323788f4SGreg Roach
322323788f4SGreg Roach    /**
323323788f4SGreg Roach     * Test new spouse names
32417d74f3aSGreg Roach     *
32515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
32615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
32752348eb8SGreg Roach     *
32852348eb8SGreg Roach     * @return void
329323788f4SGreg Roach     */
3309b802b22SGreg Roach    public function testNewSpouseNames(): void
331c1010edaSGreg Roach    {
3325e933c21SGreg Roach        self::assertSame(
33313abd6f3SGreg Roach            ['NAME' => '//'],
334323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Chris /Green/', 'U')
335323788f4SGreg Roach        );
336323788f4SGreg Roach    }
337323788f4SGreg Roach}
338