xref: /webtrees/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php (revision d11be7027e34e3121be11cc025421873364403f9)
1323788f4SGreg Roach<?php
23976b470SGreg Roach
3323788f4SGreg Roach/**
4323788f4SGreg Roach * webtrees: online genealogy
5*d11be702SGreg Roach * Copyright (C) 2023 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
22cb7a42eaSGreg Roachuse Fisharebest\Webtrees\Fact;
23cb7a42eaSGreg Roachuse Fisharebest\Webtrees\Individual;
243cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase;
25cb7a42eaSGreg Roachuse Illuminate\Support\Collection;
263cfcc809SGreg Roach
27323788f4SGreg Roach/**
28c4943cffSGreg Roach * Test harness for the class LithuanianSurnameTraditionTest
29323788f4SGreg Roach */
303cfcc809SGreg Roachclass LithuanianSurnameTraditionTest extends TestCase
31c1010edaSGreg Roach{
32c4943cffSGreg Roach    private SurnameTraditionInterface $surname_tradition;
33323788f4SGreg Roach
34323788f4SGreg Roach    /**
35323788f4SGreg Roach     * Prepare the environment for these tests
3652348eb8SGreg Roach     *
3752348eb8SGreg Roach     * @return void
38323788f4SGreg Roach     */
395c48bcd6SGreg Roach    protected function setUp(): void
40c1010edaSGreg Roach    {
410115bc16SGreg Roach        parent::setUp();
420115bc16SGreg Roach
4374d6dc0eSGreg Roach        $this->surname_tradition = new LithuanianSurnameTradition();
44323788f4SGreg Roach    }
45323788f4SGreg Roach
46323788f4SGreg Roach    /**
47c1ec7145SGreg Roach     * Test whether surnames are used
4817d74f3aSGreg Roach     *
4915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
5015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
5152348eb8SGreg Roach     *
5252348eb8SGreg Roach     * @return void
53c1ec7145SGreg Roach     */
549b802b22SGreg Roach    public function testSurnames(): void
55c1010edaSGreg Roach    {
56a171b6a5SGreg Roach        self::assertSame('//', $this->surname_tradition->defaultName());
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
6452348eb8SGreg Roach     *
6552348eb8SGreg Roach     * @return void
66323788f4SGreg Roach     */
679b802b22SGreg Roach    public function testNewSonNames(): void
68c1010edaSGreg Roach    {
69cb7a42eaSGreg Roach        $father_fact = $this->createStub(Fact::class);
7083c91e47SGreg Roach        $father_fact->method('value')->willReturn('John /White/');
71cb7a42eaSGreg Roach
72cb7a42eaSGreg Roach        $father = $this->createStub(Individual::class);
7383c91e47SGreg Roach        $father->method('facts')->willReturn(new Collection([$father_fact]));
74cb7a42eaSGreg Roach
75cb7a42eaSGreg Roach        $mother_fact = $this->createStub(Fact::class);
7683c91e47SGreg Roach        $mother_fact->method('value')->willReturn('Mary /Black/');
77cb7a42eaSGreg Roach
78cb7a42eaSGreg Roach        $mother = $this->createStub(Individual::class);
7983c91e47SGreg Roach        $mother->method('facts')->willReturn(new Collection([$mother_fact]));
80cb7a42eaSGreg Roach
815e933c21SGreg Roach        self::assertSame(
828939e2c2SGreg Roach            ["1 NAME /White/\n2 TYPE BIRTH\n2 SURN White"],
83cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames($father, $mother, 'M')
84323788f4SGreg Roach        );
85323788f4SGreg Roach    }
86323788f4SGreg Roach
87323788f4SGreg Roach    /**
88323788f4SGreg Roach     * Test new daughter names
8917d74f3aSGreg Roach     *
9015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
9115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
9252348eb8SGreg Roach     *
9352348eb8SGreg Roach     * @return void
94323788f4SGreg Roach     */
959b802b22SGreg Roach    public function testNewDaughterNames(): void
96c1010edaSGreg Roach    {
97cb7a42eaSGreg Roach        $father_fact = $this->createStub(Fact::class);
9883c91e47SGreg Roach        $father_fact->method('value')->willReturn('John /White/');
99cb7a42eaSGreg Roach
100cb7a42eaSGreg Roach        $father = $this->createStub(Individual::class);
10183c91e47SGreg Roach        $father->method('facts')->willReturn(new Collection([$father_fact]));
102cb7a42eaSGreg Roach
103cb7a42eaSGreg Roach        $mother_fact = $this->createStub(Fact::class);
10483c91e47SGreg Roach        $mother_fact->method('value')->willReturn('Mary /Black/');
105cb7a42eaSGreg Roach
106cb7a42eaSGreg Roach        $mother = $this->createStub(Individual::class);
10783c91e47SGreg Roach        $mother->method('facts')->willReturn(new Collection([$mother_fact]));
108cb7a42eaSGreg Roach
1095e933c21SGreg Roach        self::assertSame(
1108939e2c2SGreg Roach            ["1 NAME /White/\n2 TYPE BIRTH\n2 SURN White"],
111cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames($father, $mother, 'F')
112323788f4SGreg Roach        );
113323788f4SGreg Roach    }
114323788f4SGreg Roach
115323788f4SGreg Roach    /**
116323788f4SGreg Roach     * Test new daughter names
11717d74f3aSGreg Roach     *
11815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
11915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
12052348eb8SGreg Roach     *
12152348eb8SGreg Roach     * @return void
122323788f4SGreg Roach     */
1239b802b22SGreg Roach    public function testNewDaughterNamesInflected(): void
124c1010edaSGreg Roach    {
125cb7a42eaSGreg Roach        $father_fact = $this->createStub(Fact::class);
12683c91e47SGreg Roach        $father_fact->method('value')->willReturn('John /Whita/');
127cb7a42eaSGreg Roach
128cb7a42eaSGreg Roach        $father = $this->createStub(Individual::class);
12983c91e47SGreg Roach        $father->method('facts')->willReturn(new Collection([$father_fact]));
130cb7a42eaSGreg Roach
131cb7a42eaSGreg Roach        $mother_fact = $this->createStub(Fact::class);
13283c91e47SGreg Roach        $mother_fact->method('value')->willReturn('Mary /Black/');
133cb7a42eaSGreg Roach
134cb7a42eaSGreg Roach        $mother = $this->createStub(Individual::class);
13583c91e47SGreg Roach        $mother->method('facts')->willReturn(new Collection([$mother_fact]));
136cb7a42eaSGreg Roach
1375e933c21SGreg Roach        self::assertSame(
1388939e2c2SGreg Roach            ["1 NAME /Whitaitė/\n2 TYPE BIRTH\n2 SURN Whita"],
139cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames($father, $mother, 'F')
140323788f4SGreg Roach        );
141cb7a42eaSGreg Roach
142cb7a42eaSGreg Roach        $father_fact = $this->createStub(Fact::class);
14383c91e47SGreg Roach        $father_fact->method('value')->willReturn('John /Whitas/');
144cb7a42eaSGreg Roach
145cb7a42eaSGreg Roach        $father = $this->createStub(Individual::class);
14683c91e47SGreg Roach        $father->method('facts')->willReturn(new Collection([$father_fact]));
147cb7a42eaSGreg Roach
1485e933c21SGreg Roach        self::assertSame(
1498939e2c2SGreg Roach            ["1 NAME /Whitaitė/\n2 TYPE BIRTH\n2 SURN Whitas"],
150cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames($father, $mother, 'F')
151323788f4SGreg Roach        );
152cb7a42eaSGreg Roach
153cb7a42eaSGreg Roach        $father_fact = $this->createStub(Fact::class);
15483c91e47SGreg Roach        $father_fact->method('value')->willReturn('John /Whitis/');
155cb7a42eaSGreg Roach
156cb7a42eaSGreg Roach        $father = $this->createStub(Individual::class);
15783c91e47SGreg Roach        $father->method('facts')->willReturn(new Collection([$father_fact]));
158cb7a42eaSGreg Roach
1595e933c21SGreg Roach        self::assertSame(
1608939e2c2SGreg Roach            ["1 NAME /Whitytė/\n2 TYPE BIRTH\n2 SURN Whitis"],
161cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames($father, $mother, 'F')
162323788f4SGreg Roach        );
163cb7a42eaSGreg Roach
164cb7a42eaSGreg Roach        $father_fact = $this->createStub(Fact::class);
16583c91e47SGreg Roach        $father_fact->method('value')->willReturn('John /Whitys/');
166cb7a42eaSGreg Roach
167cb7a42eaSGreg Roach        $father = $this->createStub(Individual::class);
16883c91e47SGreg Roach        $father->method('facts')->willReturn(new Collection([$father_fact]));
169cb7a42eaSGreg Roach
1705e933c21SGreg Roach        self::assertSame(
1718939e2c2SGreg Roach            ["1 NAME /Whitytė/\n2 TYPE BIRTH\n2 SURN Whitys"],
172cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames($father, $mother, 'F')
173323788f4SGreg Roach        );
174cb7a42eaSGreg Roach
175cb7a42eaSGreg Roach        $father_fact = $this->createStub(Fact::class);
17683c91e47SGreg Roach        $father_fact->method('value')->willReturn('John /Whitius/');
177cb7a42eaSGreg Roach
178cb7a42eaSGreg Roach        $father = $this->createStub(Individual::class);
17983c91e47SGreg Roach        $father->method('facts')->willReturn(new Collection([$father_fact]));
180cb7a42eaSGreg Roach
1815e933c21SGreg Roach        self::assertSame(
1828939e2c2SGreg Roach            ["1 NAME /Whitiūtė/\n2 TYPE BIRTH\n2 SURN Whitius"],
183cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames($father, $mother, 'F')
184323788f4SGreg Roach        );
185cb7a42eaSGreg Roach
186cb7a42eaSGreg Roach        $father_fact = $this->createStub(Fact::class);
18783c91e47SGreg Roach        $father_fact->method('value')->willReturn('John /Whitus/');
188cb7a42eaSGreg Roach
189cb7a42eaSGreg Roach        $father = $this->createStub(Individual::class);
19083c91e47SGreg Roach        $father->method('facts')->willReturn(new Collection([$father_fact]));
191cb7a42eaSGreg Roach
1925e933c21SGreg Roach        self::assertSame(
1938939e2c2SGreg Roach            ["1 NAME /Whitutė/\n2 TYPE BIRTH\n2 SURN Whitus"],
194cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames($father, $mother, 'F')
195323788f4SGreg Roach        );
196323788f4SGreg Roach    }
197323788f4SGreg Roach
198323788f4SGreg Roach    /**
199323788f4SGreg Roach     * Test new child names
20017d74f3aSGreg Roach     *
20115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
20215d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
20352348eb8SGreg Roach     *
20452348eb8SGreg Roach     * @return void
205323788f4SGreg Roach     */
2069b802b22SGreg Roach    public function testNewChildNames(): void
207c1010edaSGreg Roach    {
208cb7a42eaSGreg Roach        $father_fact = $this->createStub(Fact::class);
20983c91e47SGreg Roach        $father_fact->method('value')->willReturn('John /White/');
210cb7a42eaSGreg Roach
211cb7a42eaSGreg Roach        $father = $this->createStub(Individual::class);
21283c91e47SGreg Roach        $father->method('facts')->willReturn(new Collection([$father_fact]));
213cb7a42eaSGreg Roach
214cb7a42eaSGreg Roach        $mother_fact = $this->createStub(Fact::class);
21583c91e47SGreg Roach        $mother_fact->method('value')->willReturn('Mary /Black/');
216cb7a42eaSGreg Roach
217cb7a42eaSGreg Roach        $mother = $this->createStub(Individual::class);
21883c91e47SGreg Roach        $mother->method('facts')->willReturn(new Collection([$mother_fact]));
219cb7a42eaSGreg Roach
2205e933c21SGreg Roach        self::assertSame(
2218939e2c2SGreg Roach            ["1 NAME /White/\n2 TYPE BIRTH\n2 SURN White"],
222cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames($father, $mother, 'U')
223323788f4SGreg Roach        );
224323788f4SGreg Roach    }
225323788f4SGreg Roach
226323788f4SGreg Roach    /**
2271677a03aSGreg Roach     * Test new child names
22817d74f3aSGreg Roach     *
22915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
23015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
23152348eb8SGreg Roach     *
23252348eb8SGreg Roach     * @return void
2331677a03aSGreg Roach     */
2349b802b22SGreg Roach    public function testNewChildNamesWithNoParentsNames(): void
235c1010edaSGreg Roach    {
2365e933c21SGreg Roach        self::assertSame(
2378939e2c2SGreg Roach            ["1 NAME //\n2 TYPE BIRTH"],
238cb7a42eaSGreg Roach            $this->surname_tradition->newChildNames(null, null, 'U')
2391677a03aSGreg Roach        );
2401677a03aSGreg Roach    }
2411677a03aSGreg Roach
2421677a03aSGreg Roach    /**
243323788f4SGreg Roach     * Test new father names
24417d74f3aSGreg Roach     *
24515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
24615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
24752348eb8SGreg Roach     *
24852348eb8SGreg Roach     * @return void
249323788f4SGreg Roach     */
2509b802b22SGreg Roach    public function testNewFatherNames(): void
251c1010edaSGreg Roach    {
252cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
25383c91e47SGreg Roach        $fact->method('value')->willReturn('John /White/');
254cb7a42eaSGreg Roach
255cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
25683c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
257cb7a42eaSGreg Roach
2585e933c21SGreg Roach        self::assertSame(
2598939e2c2SGreg Roach            ["1 NAME /White/\n2 TYPE BIRTH\n2 SURN White"],
260cb7a42eaSGreg Roach            $this->surname_tradition->newParentNames($individual, 'M')
261323788f4SGreg Roach        );
262323788f4SGreg Roach    }
263323788f4SGreg Roach
264323788f4SGreg Roach    /**
265323788f4SGreg Roach     * Test new father names
26617d74f3aSGreg Roach     *
26715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
26815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
26952348eb8SGreg Roach     *
27052348eb8SGreg Roach     * @return void
271323788f4SGreg Roach     */
2729b802b22SGreg Roach    public function testNewFatherNamesInflected(): void
273c1010edaSGreg Roach    {
274cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
27583c91e47SGreg Roach        $fact->method('value')->willReturn('Mary /Whitaitė/');
276cb7a42eaSGreg Roach
277cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
27883c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
279cb7a42eaSGreg Roach
2805e933c21SGreg Roach        self::assertSame(
2818939e2c2SGreg Roach            ["1 NAME /Whitas/\n2 TYPE BIRTH\n2 SURN Whitas"],
282cb7a42eaSGreg Roach            $this->surname_tradition->newParentNames($individual, 'M')
283323788f4SGreg Roach        );
284cb7a42eaSGreg Roach
285cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
28683c91e47SGreg Roach        $fact->method('value')->willReturn('Mary /Whitytė/');
287cb7a42eaSGreg Roach
288cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
28983c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
290cb7a42eaSGreg Roach
2915e933c21SGreg Roach        self::assertSame(
2928939e2c2SGreg Roach            ["1 NAME /Whitis/\n2 TYPE BIRTH\n2 SURN Whitis"],
293cb7a42eaSGreg Roach            $this->surname_tradition->newParentNames($individual, 'M')
294323788f4SGreg Roach        );
295cb7a42eaSGreg Roach
296cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
29783c91e47SGreg Roach        $fact->method('value')->willReturn('Mary /Whitiūtė/');
298cb7a42eaSGreg Roach
299cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
30083c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
301cb7a42eaSGreg Roach
3025e933c21SGreg Roach        self::assertSame(
3038939e2c2SGreg Roach            ["1 NAME /Whitius/\n2 TYPE BIRTH\n2 SURN Whitius"],
304cb7a42eaSGreg Roach            $this->surname_tradition->newParentNames($individual, 'M')
305323788f4SGreg Roach        );
306cb7a42eaSGreg Roach
307cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
30883c91e47SGreg Roach        $fact->method('value')->willReturn('Mary /Whitutė/');
309cb7a42eaSGreg Roach
310cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
31183c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
312cb7a42eaSGreg Roach
3135e933c21SGreg Roach        self::assertSame(
3148939e2c2SGreg Roach            ["1 NAME /Whitus/\n2 TYPE BIRTH\n2 SURN Whitus"],
315cb7a42eaSGreg Roach            $this->surname_tradition->newParentNames($individual, 'M')
316323788f4SGreg Roach        );
317323788f4SGreg Roach    }
318323788f4SGreg Roach
319323788f4SGreg Roach    /**
320323788f4SGreg Roach     * Test new mother 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     */
3279b802b22SGreg Roach    public function testNewMotherNames(): void
328c1010edaSGreg Roach    {
329cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
33083c91e47SGreg Roach        $fact->method('value')->willReturn('John /White/');
331cb7a42eaSGreg Roach
332cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
33383c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
334cb7a42eaSGreg Roach
3355e933c21SGreg Roach        self::assertSame(
3368939e2c2SGreg Roach            ["1 NAME //\n2 TYPE BIRTH"],
337cb7a42eaSGreg Roach            $this->surname_tradition->newParentNames($individual, 'F')
338323788f4SGreg Roach        );
339323788f4SGreg Roach    }
340323788f4SGreg Roach
341323788f4SGreg Roach    /**
342323788f4SGreg Roach     * Test new parent names
34317d74f3aSGreg Roach     *
34415d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
34515d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
34652348eb8SGreg Roach     *
34752348eb8SGreg Roach     * @return void
348323788f4SGreg Roach     */
3499b802b22SGreg Roach    public function testNewParentNames(): void
350c1010edaSGreg Roach    {
351cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
35283c91e47SGreg Roach        $fact->method('value')->willReturn('John /White/');
353cb7a42eaSGreg Roach
354cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
35583c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
356cb7a42eaSGreg Roach
3575e933c21SGreg Roach        self::assertSame(
3588939e2c2SGreg Roach            ["1 NAME //\n2 TYPE BIRTH"],
359cb7a42eaSGreg Roach            $this->surname_tradition->newParentNames($individual, 'U')
360323788f4SGreg Roach        );
361323788f4SGreg Roach    }
362323788f4SGreg Roach
363323788f4SGreg Roach    /**
364323788f4SGreg Roach     * Test new husband names
36517d74f3aSGreg Roach     *
36615d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
36715d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
36852348eb8SGreg Roach     *
36952348eb8SGreg Roach     * @return void
370323788f4SGreg Roach     */
3719b802b22SGreg Roach    public function testNewHusbandNames(): void
372c1010edaSGreg Roach    {
373cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
37483c91e47SGreg Roach        $fact->method('value')->willReturn('Mary /Black/');
375cb7a42eaSGreg Roach
376cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
37783c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
378cb7a42eaSGreg Roach
3795e933c21SGreg Roach        self::assertSame(
3808939e2c2SGreg Roach            ["1 NAME //\n2 TYPE BIRTH"],
381cb7a42eaSGreg Roach            $this->surname_tradition->newSpouseNames($individual, 'M')
382323788f4SGreg Roach        );
383323788f4SGreg Roach    }
384323788f4SGreg Roach
385323788f4SGreg Roach    /**
386323788f4SGreg Roach     * Test new wife names
38717d74f3aSGreg Roach     *
38815d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
38915d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
39052348eb8SGreg Roach     *
39152348eb8SGreg Roach     * @return void
392323788f4SGreg Roach     */
3939b802b22SGreg Roach    public function testNewWifeNames(): void
394c1010edaSGreg Roach    {
395cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
39683c91e47SGreg Roach        $fact->method('value')->willReturn('John /White/');
397cb7a42eaSGreg Roach
398cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
39983c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
400cb7a42eaSGreg Roach
4015e933c21SGreg Roach        self::assertSame(
4028939e2c2SGreg Roach            ["1 NAME //\n2 TYPE BIRTH", "1 NAME /White/\n2 TYPE MARRIED\n2 SURN White"],
403cb7a42eaSGreg Roach            $this->surname_tradition->newSpouseNames($individual, 'F')
404323788f4SGreg Roach        );
405323788f4SGreg Roach    }
406323788f4SGreg Roach
407323788f4SGreg Roach    /**
408323788f4SGreg Roach     * Test new spouse names
40917d74f3aSGreg Roach     *
41015d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
41115d603e7SGreg Roach     * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
41252348eb8SGreg Roach     *
41352348eb8SGreg Roach     * @return void
414323788f4SGreg Roach     */
4159b802b22SGreg Roach    public function testNewSpouseNames(): void
416c1010edaSGreg Roach    {
417cb7a42eaSGreg Roach        $fact = $this->createStub(Fact::class);
41883c91e47SGreg Roach        $fact->method('value')->willReturn('John /White/');
419cb7a42eaSGreg Roach
420cb7a42eaSGreg Roach        $individual = $this->createStub(Individual::class);
42183c91e47SGreg Roach        $individual->method('facts')->willReturn(new Collection([$fact]));
422cb7a42eaSGreg Roach
4235e933c21SGreg Roach        self::assertSame(
4248939e2c2SGreg Roach            ["1 NAME //\n2 TYPE BIRTH"],
425cb7a42eaSGreg Roach            $this->surname_tradition->newSpouseNames($individual, 'U')
426323788f4SGreg Roach        );
427323788f4SGreg Roach    }
428323788f4SGreg Roach}
429