xref: /webtrees/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php (revision 84e2cf4e2b1803b300330f631d304db1a3c443dd)
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 */
16*84e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition;
17c1010edaSGreg 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*84e2cf4eSGreg Roachclass LithuanianSurnameTraditionTest extends \Fisharebest\Webtrees\TestCase
25c1010edaSGreg Roach{
26323788f4SGreg Roach    /** @var SurnameTraditionInterface */
27323788f4SGreg Roach    private $surname_tradition;
28323788f4SGreg Roach
29323788f4SGreg Roach    /**
30323788f4SGreg Roach     * Prepare the environment for these tests
31323788f4SGreg Roach     */
32c1010edaSGreg Roach    public function setUp()
33c1010edaSGreg 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     */
43c1010edaSGreg Roach    public function testMarriedSurnames()
44c1010edaSGreg 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     */
54c1010edaSGreg Roach    public function testSurnames()
55c1010edaSGreg 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     */
65c1010edaSGreg Roach    public function testNewSonNames()
66c1010edaSGreg Roach    {
67323788f4SGreg Roach        $this->assertSame(
68c1010edaSGreg Roach            [
69c1010edaSGreg Roach                'NAME' => '/White/',
70c1010edaSGreg Roach                'SURN' => 'White',
71c1010edaSGreg 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     */
82c1010edaSGreg Roach    public function testNewDaughterNames()
83c1010edaSGreg Roach    {
84323788f4SGreg Roach        $this->assertSame(
85c1010edaSGreg Roach            [
86c1010edaSGreg Roach                'NAME' => '/White/',
87c1010edaSGreg Roach                'SURN' => 'White',
88c1010edaSGreg 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     */
99c1010edaSGreg Roach    public function testNewDaughterNamesInflected()
100c1010edaSGreg Roach    {
101323788f4SGreg Roach        $this->assertSame(
102c1010edaSGreg Roach            [
103c1010edaSGreg Roach                'NAME' => '/Whitaitė/',
104c1010edaSGreg Roach                'SURN' => 'Whita',
105c1010edaSGreg Roach            ],
106323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F')
107323788f4SGreg Roach        );
108323788f4SGreg Roach        $this->assertSame(
109c1010edaSGreg Roach            [
110c1010edaSGreg Roach                'NAME' => '/Whitaitė/',
111c1010edaSGreg Roach                'SURN' => 'Whitas',
112c1010edaSGreg Roach            ],
113323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F')
114323788f4SGreg Roach        );
115323788f4SGreg Roach        $this->assertSame(
116c1010edaSGreg Roach            [
117c1010edaSGreg Roach                'NAME' => '/Whitytė/',
118c1010edaSGreg Roach                'SURN' => 'Whitis',
119c1010edaSGreg Roach            ],
120323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F')
121323788f4SGreg Roach        );
122323788f4SGreg Roach        $this->assertSame(
123c1010edaSGreg Roach            [
124c1010edaSGreg Roach                'NAME' => '/Whitytė/',
125c1010edaSGreg Roach                'SURN' => 'Whitys',
126c1010edaSGreg Roach            ],
127323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F')
128323788f4SGreg Roach        );
129323788f4SGreg Roach        $this->assertSame(
130c1010edaSGreg Roach            [
131c1010edaSGreg Roach                'NAME' => '/Whitiūtė/',
132c1010edaSGreg Roach                'SURN' => 'Whitius',
133c1010edaSGreg Roach            ],
134323788f4SGreg Roach            $this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F')
135323788f4SGreg Roach        );
136323788f4SGreg Roach        $this->assertSame(
137c1010edaSGreg Roach            [
138c1010edaSGreg Roach                'NAME' => '/Whitutė/',
139c1010edaSGreg Roach                'SURN' => 'Whitus',
140c1010edaSGreg 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     */
151c1010edaSGreg Roach    public function testNewChildNames()
152c1010edaSGreg Roach    {
153323788f4SGreg Roach        $this->assertSame(
154c1010edaSGreg Roach            [
155c1010edaSGreg Roach                'NAME' => '/White/',
156c1010edaSGreg Roach                'SURN' => 'White',
157c1010edaSGreg 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     */
168c1010edaSGreg Roach    public function testNewChildNamesWithNoParentsNames()
169c1010edaSGreg 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     */
182c1010edaSGreg Roach    public function testNewFatherNames()
183c1010edaSGreg Roach    {
184323788f4SGreg Roach        $this->assertSame(
185c1010edaSGreg Roach            [
186c1010edaSGreg Roach                'NAME' => '/White/',
187c1010edaSGreg Roach                'SURN' => 'White',
188c1010edaSGreg 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     */
199c1010edaSGreg Roach    public function testNewFatherNamesInflected()
200c1010edaSGreg Roach    {
201323788f4SGreg Roach        $this->assertSame(
202c1010edaSGreg Roach            [
203c1010edaSGreg Roach                'NAME' => '/Whitas/',
204c1010edaSGreg Roach                'SURN' => 'Whitas',
205c1010edaSGreg Roach            ],
206323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M')
207323788f4SGreg Roach        );
208323788f4SGreg Roach        $this->assertSame(
209c1010edaSGreg Roach            [
210c1010edaSGreg Roach                'NAME' => '/Whitis/',
211c1010edaSGreg Roach                'SURN' => 'Whitis',
212c1010edaSGreg Roach            ],
213323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitytė/', 'M')
214323788f4SGreg Roach        );
215323788f4SGreg Roach        $this->assertSame(
216c1010edaSGreg Roach            [
217c1010edaSGreg Roach                'NAME' => '/Whitius/',
218c1010edaSGreg Roach                'SURN' => 'Whitius',
219c1010edaSGreg Roach            ],
220323788f4SGreg Roach            $this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M')
221323788f4SGreg Roach        );
222323788f4SGreg Roach        $this->assertSame(
223c1010edaSGreg Roach            [
224c1010edaSGreg Roach                'NAME' => '/Whitus/',
225c1010edaSGreg Roach                'SURN' => 'Whitus',
226c1010edaSGreg 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     */
237c1010edaSGreg Roach    public function testNewMotherNames()
238c1010edaSGreg 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     */
251c1010edaSGreg Roach    public function testNewParentNames()
252c1010edaSGreg 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     */
265c1010edaSGreg Roach    public function testNewHusbandNames()
266c1010edaSGreg 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     */
279c1010edaSGreg Roach    public function testNewWifeNames()
280c1010edaSGreg Roach    {
281323788f4SGreg Roach        $this->assertSame(
282c1010edaSGreg Roach            [
283c1010edaSGreg Roach                'NAME'   => '//',
284c1010edaSGreg Roach                '_MARNM' => '/White/',
285c1010edaSGreg 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     */
296c1010edaSGreg Roach    public function testNewSpouseNames()
297c1010edaSGreg Roach    {
298323788f4SGreg Roach        $this->assertSame(
29913abd6f3SGreg Roach            ['NAME' => '//'],
300323788f4SGreg Roach            $this->surname_tradition->newSpouseNames('Chris /Green/', 'U')
301323788f4SGreg Roach        );
302323788f4SGreg Roach    }
303323788f4SGreg Roach}
304