1323788f4SGreg Roach<?php 23976b470SGreg Roach 3323788f4SGreg Roach/** 4323788f4SGreg Roach * webtrees: online genealogy 58fcd0d32SGreg Roach * Copyright (C) 2019 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 15323788f4SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 16323788f4SGreg Roach */ 17*fcfa147eSGreg Roach 18e7f56f2aSGreg Roachdeclare(strict_types=1); 19e7f56f2aSGreg Roach 2084e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition; 21c1010edaSGreg Roach 223cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase; 233cfcc809SGreg Roach 24323788f4SGreg Roach/** 25323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition 26323788f4SGreg Roach */ 273cfcc809SGreg Roachclass LithuanianSurnameTraditionTest extends TestCase 28c1010edaSGreg Roach{ 29323788f4SGreg Roach /** @var SurnameTraditionInterface */ 30323788f4SGreg Roach private $surname_tradition; 31323788f4SGreg Roach 32323788f4SGreg Roach /** 33323788f4SGreg Roach * Prepare the environment for these tests 3452348eb8SGreg Roach * 3552348eb8SGreg Roach * @return void 36323788f4SGreg Roach */ 375c48bcd6SGreg Roach protected function setUp(): void 38c1010edaSGreg Roach { 390115bc16SGreg Roach parent::setUp(); 400115bc16SGreg Roach 4174d6dc0eSGreg Roach $this->surname_tradition = new LithuanianSurnameTradition(); 42323788f4SGreg Roach } 43323788f4SGreg Roach 44323788f4SGreg Roach /** 45323788f4SGreg Roach * Test whether married surnames are used 4617d74f3aSGreg Roach * 4715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 4815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 4952348eb8SGreg Roach * 5052348eb8SGreg Roach * @return void 51323788f4SGreg Roach */ 529b802b22SGreg Roach public function testMarriedSurnames(): void 53c1010edaSGreg Roach { 54a32e6421SGreg Roach $this->assertTrue($this->surname_tradition->hasMarriedNames()); 55323788f4SGreg Roach } 56323788f4SGreg Roach 57323788f4SGreg Roach /** 58c1ec7145SGreg Roach * Test whether surnames are used 5917d74f3aSGreg Roach * 6015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 6115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 6252348eb8SGreg Roach * 6352348eb8SGreg Roach * @return void 64c1ec7145SGreg Roach */ 659b802b22SGreg Roach public function testSurnames(): void 66c1010edaSGreg Roach { 67a32e6421SGreg Roach $this->assertTrue($this->surname_tradition->hasSurnames()); 68c1ec7145SGreg Roach } 69c1ec7145SGreg Roach 70c1ec7145SGreg Roach /** 71323788f4SGreg Roach * Test new son names 7217d74f3aSGreg Roach * 7315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 7415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 7552348eb8SGreg Roach * 7652348eb8SGreg Roach * @return void 77323788f4SGreg Roach */ 789b802b22SGreg Roach public function testNewSonNames(): void 79c1010edaSGreg Roach { 80323788f4SGreg Roach $this->assertSame( 81c1010edaSGreg Roach [ 82c1010edaSGreg Roach 'NAME' => '/White/', 83c1010edaSGreg Roach 'SURN' => 'White', 84c1010edaSGreg Roach ], 85323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M') 86323788f4SGreg Roach ); 87323788f4SGreg Roach } 88323788f4SGreg Roach 89323788f4SGreg Roach /** 90323788f4SGreg Roach * Test new daughter names 9117d74f3aSGreg Roach * 9215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 9315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 9452348eb8SGreg Roach * 9552348eb8SGreg Roach * @return void 96323788f4SGreg Roach */ 979b802b22SGreg Roach public function testNewDaughterNames(): void 98c1010edaSGreg Roach { 99323788f4SGreg Roach $this->assertSame( 100c1010edaSGreg Roach [ 101c1010edaSGreg Roach 'NAME' => '/White/', 102c1010edaSGreg Roach 'SURN' => 'White', 103c1010edaSGreg Roach ], 104323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F') 105323788f4SGreg Roach ); 106323788f4SGreg Roach } 107323788f4SGreg Roach 108323788f4SGreg Roach /** 109323788f4SGreg Roach * Test new daughter names 11017d74f3aSGreg Roach * 11115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 11215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 11352348eb8SGreg Roach * 11452348eb8SGreg Roach * @return void 115323788f4SGreg Roach */ 1169b802b22SGreg Roach public function testNewDaughterNamesInflected(): void 117c1010edaSGreg Roach { 118323788f4SGreg Roach $this->assertSame( 119c1010edaSGreg Roach [ 120c1010edaSGreg Roach 'NAME' => '/Whitaitė/', 121c1010edaSGreg Roach 'SURN' => 'Whita', 122c1010edaSGreg Roach ], 123323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F') 124323788f4SGreg Roach ); 125323788f4SGreg Roach $this->assertSame( 126c1010edaSGreg Roach [ 127c1010edaSGreg Roach 'NAME' => '/Whitaitė/', 128c1010edaSGreg Roach 'SURN' => 'Whitas', 129c1010edaSGreg Roach ], 130323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F') 131323788f4SGreg Roach ); 132323788f4SGreg Roach $this->assertSame( 133c1010edaSGreg Roach [ 134c1010edaSGreg Roach 'NAME' => '/Whitytė/', 135c1010edaSGreg Roach 'SURN' => 'Whitis', 136c1010edaSGreg Roach ], 137323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F') 138323788f4SGreg Roach ); 139323788f4SGreg Roach $this->assertSame( 140c1010edaSGreg Roach [ 141c1010edaSGreg Roach 'NAME' => '/Whitytė/', 142c1010edaSGreg Roach 'SURN' => 'Whitys', 143c1010edaSGreg Roach ], 144323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F') 145323788f4SGreg Roach ); 146323788f4SGreg Roach $this->assertSame( 147c1010edaSGreg Roach [ 148c1010edaSGreg Roach 'NAME' => '/Whitiūtė/', 149c1010edaSGreg Roach 'SURN' => 'Whitius', 150c1010edaSGreg Roach ], 151323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F') 152323788f4SGreg Roach ); 153323788f4SGreg Roach $this->assertSame( 154c1010edaSGreg Roach [ 155c1010edaSGreg Roach 'NAME' => '/Whitutė/', 156c1010edaSGreg Roach 'SURN' => 'Whitus', 157c1010edaSGreg Roach ], 158323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F') 159323788f4SGreg Roach ); 160323788f4SGreg Roach } 161323788f4SGreg Roach 162323788f4SGreg Roach /** 163323788f4SGreg Roach * Test new child names 16417d74f3aSGreg Roach * 16515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 16615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 16752348eb8SGreg Roach * 16852348eb8SGreg Roach * @return void 169323788f4SGreg Roach */ 1709b802b22SGreg Roach public function testNewChildNames(): void 171c1010edaSGreg Roach { 172323788f4SGreg Roach $this->assertSame( 173c1010edaSGreg Roach [ 174c1010edaSGreg Roach 'NAME' => '/White/', 175c1010edaSGreg Roach 'SURN' => 'White', 176c1010edaSGreg Roach ], 177323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U') 178323788f4SGreg Roach ); 179323788f4SGreg Roach } 180323788f4SGreg Roach 181323788f4SGreg Roach /** 1821677a03aSGreg Roach * Test new child names 18317d74f3aSGreg Roach * 18415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 18515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 18652348eb8SGreg Roach * 18752348eb8SGreg Roach * @return void 1881677a03aSGreg Roach */ 1899b802b22SGreg Roach public function testNewChildNamesWithNoParentsNames(): void 190c1010edaSGreg Roach { 1911677a03aSGreg Roach $this->assertSame( 19213abd6f3SGreg Roach ['NAME' => '//'], 1931677a03aSGreg Roach $this->surname_tradition->newChildNames('', '', 'U') 1941677a03aSGreg Roach ); 1951677a03aSGreg Roach } 1961677a03aSGreg Roach 1971677a03aSGreg Roach /** 198323788f4SGreg Roach * Test new father names 19917d74f3aSGreg Roach * 20015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 20115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 20252348eb8SGreg Roach * 20352348eb8SGreg Roach * @return void 204323788f4SGreg Roach */ 2059b802b22SGreg Roach public function testNewFatherNames(): void 206c1010edaSGreg Roach { 207323788f4SGreg Roach $this->assertSame( 208c1010edaSGreg Roach [ 209c1010edaSGreg Roach 'NAME' => '/White/', 210c1010edaSGreg Roach 'SURN' => 'White', 211c1010edaSGreg Roach ], 212323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'M') 213323788f4SGreg Roach ); 214323788f4SGreg Roach } 215323788f4SGreg Roach 216323788f4SGreg Roach /** 217323788f4SGreg Roach * Test new father names 21817d74f3aSGreg Roach * 21915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 22015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 22152348eb8SGreg Roach * 22252348eb8SGreg Roach * @return void 223323788f4SGreg Roach */ 2249b802b22SGreg Roach public function testNewFatherNamesInflected(): void 225c1010edaSGreg Roach { 226323788f4SGreg Roach $this->assertSame( 227c1010edaSGreg Roach [ 228c1010edaSGreg Roach 'NAME' => '/Whitas/', 229c1010edaSGreg Roach 'SURN' => 'Whitas', 230c1010edaSGreg Roach ], 231323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M') 232323788f4SGreg Roach ); 233323788f4SGreg Roach $this->assertSame( 234c1010edaSGreg Roach [ 235c1010edaSGreg Roach 'NAME' => '/Whitis/', 236c1010edaSGreg Roach 'SURN' => 'Whitis', 237c1010edaSGreg Roach ], 238323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitytė/', 'M') 239323788f4SGreg Roach ); 240323788f4SGreg Roach $this->assertSame( 241c1010edaSGreg Roach [ 242c1010edaSGreg Roach 'NAME' => '/Whitius/', 243c1010edaSGreg Roach 'SURN' => 'Whitius', 244c1010edaSGreg Roach ], 245323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M') 246323788f4SGreg Roach ); 247323788f4SGreg Roach $this->assertSame( 248c1010edaSGreg Roach [ 249c1010edaSGreg Roach 'NAME' => '/Whitus/', 250c1010edaSGreg Roach 'SURN' => 'Whitus', 251c1010edaSGreg Roach ], 252323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitutė/', 'M') 253323788f4SGreg Roach ); 254323788f4SGreg Roach } 255323788f4SGreg Roach 256323788f4SGreg Roach /** 257323788f4SGreg Roach * Test new mother names 25817d74f3aSGreg Roach * 25915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 26015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 26152348eb8SGreg Roach * 26252348eb8SGreg Roach * @return void 263323788f4SGreg Roach */ 2649b802b22SGreg Roach public function testNewMotherNames(): void 265c1010edaSGreg Roach { 266323788f4SGreg Roach $this->assertSame( 26713abd6f3SGreg Roach ['NAME' => '//'], 268323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'F') 269323788f4SGreg Roach ); 270323788f4SGreg Roach } 271323788f4SGreg Roach 272323788f4SGreg Roach /** 273323788f4SGreg Roach * Test new parent names 27417d74f3aSGreg Roach * 27515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 27615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 27752348eb8SGreg Roach * 27852348eb8SGreg Roach * @return void 279323788f4SGreg Roach */ 2809b802b22SGreg Roach public function testNewParentNames(): void 281c1010edaSGreg Roach { 282323788f4SGreg Roach $this->assertSame( 28313abd6f3SGreg Roach ['NAME' => '//'], 284323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'U') 285323788f4SGreg Roach ); 286323788f4SGreg Roach } 287323788f4SGreg Roach 288323788f4SGreg Roach /** 289323788f4SGreg Roach * Test new husband names 29017d74f3aSGreg Roach * 29115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 29215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 29352348eb8SGreg Roach * 29452348eb8SGreg Roach * @return void 295323788f4SGreg Roach */ 2969b802b22SGreg Roach public function testNewHusbandNames(): void 297c1010edaSGreg Roach { 298323788f4SGreg Roach $this->assertSame( 29913abd6f3SGreg Roach ['NAME' => '//'], 300323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Mary /Black/', 'M') 301323788f4SGreg Roach ); 302323788f4SGreg Roach } 303323788f4SGreg Roach 304323788f4SGreg Roach /** 305323788f4SGreg Roach * Test new wife names 30617d74f3aSGreg Roach * 30715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 30815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 30952348eb8SGreg Roach * 31052348eb8SGreg Roach * @return void 311323788f4SGreg Roach */ 3129b802b22SGreg Roach public function testNewWifeNames(): void 313c1010edaSGreg Roach { 314323788f4SGreg Roach $this->assertSame( 315c1010edaSGreg Roach [ 316c1010edaSGreg Roach 'NAME' => '//', 317c1010edaSGreg Roach '_MARNM' => '/White/', 318c1010edaSGreg Roach ], 319323788f4SGreg Roach $this->surname_tradition->newSpouseNames('John /White/', 'F') 320323788f4SGreg Roach ); 321323788f4SGreg Roach } 322323788f4SGreg Roach 323323788f4SGreg Roach /** 324323788f4SGreg Roach * Test new spouse names 32517d74f3aSGreg Roach * 32615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 32715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 32852348eb8SGreg Roach * 32952348eb8SGreg Roach * @return void 330323788f4SGreg Roach */ 3319b802b22SGreg Roach public function testNewSpouseNames(): void 332c1010edaSGreg Roach { 333323788f4SGreg Roach $this->assertSame( 33413abd6f3SGreg Roach ['NAME' => '//'], 335323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Chris /Green/', 'U') 336323788f4SGreg Roach ); 337323788f4SGreg Roach } 338323788f4SGreg Roach} 339