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 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 /** 47323788f4SGreg Roach * Test whether married 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 53323788f4SGreg Roach */ 549b802b22SGreg Roach public function testMarriedSurnames(): void 55c1010edaSGreg Roach { 565e933c21SGreg Roach self::assertTrue($this->surname_tradition->hasMarriedNames()); 57323788f4SGreg Roach } 58323788f4SGreg Roach 59323788f4SGreg Roach /** 60c1ec7145SGreg Roach * Test whether surnames are used 6117d74f3aSGreg Roach * 6215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 6315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 6452348eb8SGreg Roach * 6552348eb8SGreg Roach * @return void 66c1ec7145SGreg Roach */ 679b802b22SGreg Roach public function testSurnames(): void 68c1010edaSGreg Roach { 695e933c21SGreg Roach self::assertTrue($this->surname_tradition->hasSurnames()); 70c1ec7145SGreg Roach } 71c1ec7145SGreg Roach 72c1ec7145SGreg Roach /** 73323788f4SGreg Roach * Test new son names 7417d74f3aSGreg Roach * 7515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 7615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 7752348eb8SGreg Roach * 7852348eb8SGreg Roach * @return void 79323788f4SGreg Roach */ 809b802b22SGreg Roach public function testNewSonNames(): void 81c1010edaSGreg Roach { 82cb7a42eaSGreg Roach $father_fact = $this->createStub(Fact::class); 83*83c91e47SGreg Roach $father_fact->method('value')->willReturn('John /White/'); 84cb7a42eaSGreg Roach 85cb7a42eaSGreg Roach $father = $this->createStub(Individual::class); 86*83c91e47SGreg Roach $father->method('facts')->willReturn(new Collection([$father_fact])); 87cb7a42eaSGreg Roach 88cb7a42eaSGreg Roach $mother_fact = $this->createStub(Fact::class); 89*83c91e47SGreg Roach $mother_fact->method('value')->willReturn('Mary /Black/'); 90cb7a42eaSGreg Roach 91cb7a42eaSGreg Roach $mother = $this->createStub(Individual::class); 92*83c91e47SGreg Roach $mother->method('facts')->willReturn(new Collection([$mother_fact])); 93cb7a42eaSGreg Roach 945e933c21SGreg Roach self::assertSame( 95cb7a42eaSGreg Roach ["1 NAME /White/\n2 TYPE birth\n2 SURN White"], 96cb7a42eaSGreg Roach $this->surname_tradition->newChildNames($father, $mother, 'M') 97323788f4SGreg Roach ); 98323788f4SGreg Roach } 99323788f4SGreg Roach 100323788f4SGreg Roach /** 101323788f4SGreg Roach * Test new daughter names 10217d74f3aSGreg Roach * 10315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 10415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 10552348eb8SGreg Roach * 10652348eb8SGreg Roach * @return void 107323788f4SGreg Roach */ 1089b802b22SGreg Roach public function testNewDaughterNames(): void 109c1010edaSGreg Roach { 110cb7a42eaSGreg Roach $father_fact = $this->createStub(Fact::class); 111*83c91e47SGreg Roach $father_fact->method('value')->willReturn('John /White/'); 112cb7a42eaSGreg Roach 113cb7a42eaSGreg Roach $father = $this->createStub(Individual::class); 114*83c91e47SGreg Roach $father->method('facts')->willReturn(new Collection([$father_fact])); 115cb7a42eaSGreg Roach 116cb7a42eaSGreg Roach $mother_fact = $this->createStub(Fact::class); 117*83c91e47SGreg Roach $mother_fact->method('value')->willReturn('Mary /Black/'); 118cb7a42eaSGreg Roach 119cb7a42eaSGreg Roach $mother = $this->createStub(Individual::class); 120*83c91e47SGreg Roach $mother->method('facts')->willReturn(new Collection([$mother_fact])); 121cb7a42eaSGreg Roach 1225e933c21SGreg Roach self::assertSame( 123cb7a42eaSGreg Roach ["1 NAME /White/\n2 TYPE birth\n2 SURN White"], 124cb7a42eaSGreg Roach $this->surname_tradition->newChildNames($father, $mother, 'F') 125323788f4SGreg Roach ); 126323788f4SGreg Roach } 127323788f4SGreg Roach 128323788f4SGreg Roach /** 129323788f4SGreg Roach * Test new daughter names 13017d74f3aSGreg Roach * 13115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 13215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 13352348eb8SGreg Roach * 13452348eb8SGreg Roach * @return void 135323788f4SGreg Roach */ 1369b802b22SGreg Roach public function testNewDaughterNamesInflected(): void 137c1010edaSGreg Roach { 138cb7a42eaSGreg Roach $father_fact = $this->createStub(Fact::class); 139*83c91e47SGreg Roach $father_fact->method('value')->willReturn('John /Whita/'); 140cb7a42eaSGreg Roach 141cb7a42eaSGreg Roach $father = $this->createStub(Individual::class); 142*83c91e47SGreg Roach $father->method('facts')->willReturn(new Collection([$father_fact])); 143cb7a42eaSGreg Roach 144cb7a42eaSGreg Roach $mother_fact = $this->createStub(Fact::class); 145*83c91e47SGreg Roach $mother_fact->method('value')->willReturn('Mary /Black/'); 146cb7a42eaSGreg Roach 147cb7a42eaSGreg Roach $mother = $this->createStub(Individual::class); 148*83c91e47SGreg Roach $mother->method('facts')->willReturn(new Collection([$mother_fact])); 149cb7a42eaSGreg Roach 1505e933c21SGreg Roach self::assertSame( 151cb7a42eaSGreg Roach ["1 NAME /Whitaitė/\n2 TYPE birth\n2 SURN Whita"], 152cb7a42eaSGreg Roach $this->surname_tradition->newChildNames($father, $mother, 'F') 153323788f4SGreg Roach ); 154cb7a42eaSGreg Roach 155cb7a42eaSGreg Roach $father_fact = $this->createStub(Fact::class); 156*83c91e47SGreg Roach $father_fact->method('value')->willReturn('John /Whitas/'); 157cb7a42eaSGreg Roach 158cb7a42eaSGreg Roach $father = $this->createStub(Individual::class); 159*83c91e47SGreg Roach $father->method('facts')->willReturn(new Collection([$father_fact])); 160cb7a42eaSGreg Roach 1615e933c21SGreg Roach self::assertSame( 162cb7a42eaSGreg Roach ["1 NAME /Whitaitė/\n2 TYPE birth\n2 SURN Whitas"], 163cb7a42eaSGreg Roach $this->surname_tradition->newChildNames($father, $mother, 'F') 164323788f4SGreg Roach ); 165cb7a42eaSGreg Roach 166cb7a42eaSGreg Roach $father_fact = $this->createStub(Fact::class); 167*83c91e47SGreg Roach $father_fact->method('value')->willReturn('John /Whitis/'); 168cb7a42eaSGreg Roach 169cb7a42eaSGreg Roach $father = $this->createStub(Individual::class); 170*83c91e47SGreg Roach $father->method('facts')->willReturn(new Collection([$father_fact])); 171cb7a42eaSGreg Roach 1725e933c21SGreg Roach self::assertSame( 173cb7a42eaSGreg Roach ["1 NAME /Whitytė/\n2 TYPE birth\n2 SURN Whitis"], 174cb7a42eaSGreg Roach $this->surname_tradition->newChildNames($father, $mother, 'F') 175323788f4SGreg Roach ); 176cb7a42eaSGreg Roach 177cb7a42eaSGreg Roach $father_fact = $this->createStub(Fact::class); 178*83c91e47SGreg Roach $father_fact->method('value')->willReturn('John /Whitys/'); 179cb7a42eaSGreg Roach 180cb7a42eaSGreg Roach $father = $this->createStub(Individual::class); 181*83c91e47SGreg Roach $father->method('facts')->willReturn(new Collection([$father_fact])); 182cb7a42eaSGreg Roach 1835e933c21SGreg Roach self::assertSame( 184cb7a42eaSGreg Roach ["1 NAME /Whitytė/\n2 TYPE birth\n2 SURN Whitys"], 185cb7a42eaSGreg Roach $this->surname_tradition->newChildNames($father, $mother, 'F') 186323788f4SGreg Roach ); 187cb7a42eaSGreg Roach 188cb7a42eaSGreg Roach $father_fact = $this->createStub(Fact::class); 189*83c91e47SGreg Roach $father_fact->method('value')->willReturn('John /Whitius/'); 190cb7a42eaSGreg Roach 191cb7a42eaSGreg Roach $father = $this->createStub(Individual::class); 192*83c91e47SGreg Roach $father->method('facts')->willReturn(new Collection([$father_fact])); 193cb7a42eaSGreg Roach 1945e933c21SGreg Roach self::assertSame( 195cb7a42eaSGreg Roach ["1 NAME /Whitiūtė/\n2 TYPE birth\n2 SURN Whitius"], 196cb7a42eaSGreg Roach $this->surname_tradition->newChildNames($father, $mother, 'F') 197323788f4SGreg Roach ); 198cb7a42eaSGreg Roach 199cb7a42eaSGreg Roach $father_fact = $this->createStub(Fact::class); 200*83c91e47SGreg Roach $father_fact->method('value')->willReturn('John /Whitus/'); 201cb7a42eaSGreg Roach 202cb7a42eaSGreg Roach $father = $this->createStub(Individual::class); 203*83c91e47SGreg Roach $father->method('facts')->willReturn(new Collection([$father_fact])); 204cb7a42eaSGreg Roach 2055e933c21SGreg Roach self::assertSame( 206cb7a42eaSGreg Roach ["1 NAME /Whitutė/\n2 TYPE birth\n2 SURN Whitus"], 207cb7a42eaSGreg Roach $this->surname_tradition->newChildNames($father, $mother, 'F') 208323788f4SGreg Roach ); 209323788f4SGreg Roach } 210323788f4SGreg Roach 211323788f4SGreg Roach /** 212323788f4SGreg Roach * Test new child names 21317d74f3aSGreg Roach * 21415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 21515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 21652348eb8SGreg Roach * 21752348eb8SGreg Roach * @return void 218323788f4SGreg Roach */ 2199b802b22SGreg Roach public function testNewChildNames(): void 220c1010edaSGreg Roach { 221cb7a42eaSGreg Roach $father_fact = $this->createStub(Fact::class); 222*83c91e47SGreg Roach $father_fact->method('value')->willReturn('John /White/'); 223cb7a42eaSGreg Roach 224cb7a42eaSGreg Roach $father = $this->createStub(Individual::class); 225*83c91e47SGreg Roach $father->method('facts')->willReturn(new Collection([$father_fact])); 226cb7a42eaSGreg Roach 227cb7a42eaSGreg Roach $mother_fact = $this->createStub(Fact::class); 228*83c91e47SGreg Roach $mother_fact->method('value')->willReturn('Mary /Black/'); 229cb7a42eaSGreg Roach 230cb7a42eaSGreg Roach $mother = $this->createStub(Individual::class); 231*83c91e47SGreg Roach $mother->method('facts')->willReturn(new Collection([$mother_fact])); 232cb7a42eaSGreg Roach 2335e933c21SGreg Roach self::assertSame( 234cb7a42eaSGreg Roach ["1 NAME /White/\n2 TYPE birth\n2 SURN White"], 235cb7a42eaSGreg Roach $this->surname_tradition->newChildNames($father, $mother, 'U') 236323788f4SGreg Roach ); 237323788f4SGreg Roach } 238323788f4SGreg Roach 239323788f4SGreg Roach /** 2401677a03aSGreg Roach * Test new child names 24117d74f3aSGreg Roach * 24215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 24315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 24452348eb8SGreg Roach * 24552348eb8SGreg Roach * @return void 2461677a03aSGreg Roach */ 2479b802b22SGreg Roach public function testNewChildNamesWithNoParentsNames(): void 248c1010edaSGreg Roach { 2495e933c21SGreg Roach self::assertSame( 250cb7a42eaSGreg Roach ["1 NAME //\n2 TYPE birth"], 251cb7a42eaSGreg Roach $this->surname_tradition->newChildNames(null, null, 'U') 2521677a03aSGreg Roach ); 2531677a03aSGreg Roach } 2541677a03aSGreg Roach 2551677a03aSGreg Roach /** 256323788f4SGreg Roach * Test new father 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 testNewFatherNames(): void 264c1010edaSGreg Roach { 265cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 266*83c91e47SGreg Roach $fact->method('value')->willReturn('John /White/'); 267cb7a42eaSGreg Roach 268cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 269*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 270cb7a42eaSGreg Roach 2715e933c21SGreg Roach self::assertSame( 272cb7a42eaSGreg Roach ["1 NAME /White/\n2 TYPE birth\n2 SURN White"], 273cb7a42eaSGreg Roach $this->surname_tradition->newParentNames($individual, 'M') 274323788f4SGreg Roach ); 275323788f4SGreg Roach } 276323788f4SGreg Roach 277323788f4SGreg Roach /** 278323788f4SGreg Roach * Test new father names 27917d74f3aSGreg Roach * 28015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 28115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 28252348eb8SGreg Roach * 28352348eb8SGreg Roach * @return void 284323788f4SGreg Roach */ 2859b802b22SGreg Roach public function testNewFatherNamesInflected(): void 286c1010edaSGreg Roach { 287cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 288*83c91e47SGreg Roach $fact->method('value')->willReturn('Mary /Whitaitė/'); 289cb7a42eaSGreg Roach 290cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 291*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 292cb7a42eaSGreg Roach 2935e933c21SGreg Roach self::assertSame( 294cb7a42eaSGreg Roach ["1 NAME /Whitas/\n2 TYPE birth\n2 SURN Whitas"], 295cb7a42eaSGreg Roach $this->surname_tradition->newParentNames($individual, 'M') 296323788f4SGreg Roach ); 297cb7a42eaSGreg Roach 298cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 299*83c91e47SGreg Roach $fact->method('value')->willReturn('Mary /Whitytė/'); 300cb7a42eaSGreg Roach 301cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 302*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 303cb7a42eaSGreg Roach 3045e933c21SGreg Roach self::assertSame( 305cb7a42eaSGreg Roach ["1 NAME /Whitis/\n2 TYPE birth\n2 SURN Whitis"], 306cb7a42eaSGreg Roach $this->surname_tradition->newParentNames($individual, 'M') 307323788f4SGreg Roach ); 308cb7a42eaSGreg Roach 309cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 310*83c91e47SGreg Roach $fact->method('value')->willReturn('Mary /Whitiūtė/'); 311cb7a42eaSGreg Roach 312cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 313*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 314cb7a42eaSGreg Roach 3155e933c21SGreg Roach self::assertSame( 316cb7a42eaSGreg Roach ["1 NAME /Whitius/\n2 TYPE birth\n2 SURN Whitius"], 317cb7a42eaSGreg Roach $this->surname_tradition->newParentNames($individual, 'M') 318323788f4SGreg Roach ); 319cb7a42eaSGreg Roach 320cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 321*83c91e47SGreg Roach $fact->method('value')->willReturn('Mary /Whitutė/'); 322cb7a42eaSGreg Roach 323cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 324*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 325cb7a42eaSGreg Roach 3265e933c21SGreg Roach self::assertSame( 327cb7a42eaSGreg Roach ["1 NAME /Whitus/\n2 TYPE birth\n2 SURN Whitus"], 328cb7a42eaSGreg Roach $this->surname_tradition->newParentNames($individual, 'M') 329323788f4SGreg Roach ); 330323788f4SGreg Roach } 331323788f4SGreg Roach 332323788f4SGreg Roach /** 333323788f4SGreg Roach * Test new mother names 33417d74f3aSGreg Roach * 33515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 33615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 33752348eb8SGreg Roach * 33852348eb8SGreg Roach * @return void 339323788f4SGreg Roach */ 3409b802b22SGreg Roach public function testNewMotherNames(): void 341c1010edaSGreg Roach { 342cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 343*83c91e47SGreg Roach $fact->method('value')->willReturn('John /White/'); 344cb7a42eaSGreg Roach 345cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 346*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 347cb7a42eaSGreg Roach 3485e933c21SGreg Roach self::assertSame( 349cb7a42eaSGreg Roach ["1 NAME //\n2 TYPE birth"], 350cb7a42eaSGreg Roach $this->surname_tradition->newParentNames($individual, 'F') 351323788f4SGreg Roach ); 352323788f4SGreg Roach } 353323788f4SGreg Roach 354323788f4SGreg Roach /** 355323788f4SGreg Roach * Test new parent names 35617d74f3aSGreg Roach * 35715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 35815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 35952348eb8SGreg Roach * 36052348eb8SGreg Roach * @return void 361323788f4SGreg Roach */ 3629b802b22SGreg Roach public function testNewParentNames(): void 363c1010edaSGreg Roach { 364cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 365*83c91e47SGreg Roach $fact->method('value')->willReturn('John /White/'); 366cb7a42eaSGreg Roach 367cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 368*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 369cb7a42eaSGreg Roach 3705e933c21SGreg Roach self::assertSame( 371cb7a42eaSGreg Roach ["1 NAME //\n2 TYPE birth"], 372cb7a42eaSGreg Roach $this->surname_tradition->newParentNames($individual, 'U') 373323788f4SGreg Roach ); 374323788f4SGreg Roach } 375323788f4SGreg Roach 376323788f4SGreg Roach /** 377323788f4SGreg Roach * Test new husband names 37817d74f3aSGreg Roach * 37915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 38015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 38152348eb8SGreg Roach * 38252348eb8SGreg Roach * @return void 383323788f4SGreg Roach */ 3849b802b22SGreg Roach public function testNewHusbandNames(): void 385c1010edaSGreg Roach { 386cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 387*83c91e47SGreg Roach $fact->method('value')->willReturn('Mary /Black/'); 388cb7a42eaSGreg Roach 389cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 390*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 391cb7a42eaSGreg Roach 3925e933c21SGreg Roach self::assertSame( 393cb7a42eaSGreg Roach ["1 NAME //\n2 TYPE birth"], 394cb7a42eaSGreg Roach $this->surname_tradition->newSpouseNames($individual, 'M') 395323788f4SGreg Roach ); 396323788f4SGreg Roach } 397323788f4SGreg Roach 398323788f4SGreg Roach /** 399323788f4SGreg Roach * Test new wife names 40017d74f3aSGreg Roach * 40115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 40215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 40352348eb8SGreg Roach * 40452348eb8SGreg Roach * @return void 405323788f4SGreg Roach */ 4069b802b22SGreg Roach public function testNewWifeNames(): void 407c1010edaSGreg Roach { 408cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 409*83c91e47SGreg Roach $fact->method('value')->willReturn('John /White/'); 410cb7a42eaSGreg Roach 411cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 412*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 413cb7a42eaSGreg Roach 4145e933c21SGreg Roach self::assertSame( 415cb7a42eaSGreg Roach ["1 NAME //\n2 TYPE birth", "1 NAME /White/\n2 TYPE married\n2 SURN White"], 416cb7a42eaSGreg Roach $this->surname_tradition->newSpouseNames($individual, 'F') 417323788f4SGreg Roach ); 418323788f4SGreg Roach } 419323788f4SGreg Roach 420323788f4SGreg Roach /** 421323788f4SGreg Roach * Test new spouse names 42217d74f3aSGreg Roach * 42315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 42415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 42552348eb8SGreg Roach * 42652348eb8SGreg Roach * @return void 427323788f4SGreg Roach */ 4289b802b22SGreg Roach public function testNewSpouseNames(): void 429c1010edaSGreg Roach { 430cb7a42eaSGreg Roach $fact = $this->createStub(Fact::class); 431*83c91e47SGreg Roach $fact->method('value')->willReturn('John /White/'); 432cb7a42eaSGreg Roach 433cb7a42eaSGreg Roach $individual = $this->createStub(Individual::class); 434*83c91e47SGreg Roach $individual->method('facts')->willReturn(new Collection([$fact])); 435cb7a42eaSGreg Roach 4365e933c21SGreg Roach self::assertSame( 437cb7a42eaSGreg Roach ["1 NAME //\n2 TYPE birth"], 438cb7a42eaSGreg Roach $this->surname_tradition->newSpouseNames($individual, 'U') 439323788f4SGreg Roach ); 440323788f4SGreg Roach } 441323788f4SGreg Roach} 442