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*e7f56f2aSGreg Roachdeclare(strict_types=1); 17*e7f56f2aSGreg Roach 1884e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition; 19c1010edaSGreg Roach 20323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition; 21323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface; 22323788f4SGreg Roach 23323788f4SGreg Roach/** 24323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition 25323788f4SGreg Roach */ 2684e2cf4eSGreg Roachclass LithuanianSurnameTraditionTest extends \Fisharebest\Webtrees\TestCase 27c1010edaSGreg Roach{ 28323788f4SGreg Roach /** @var SurnameTraditionInterface */ 29323788f4SGreg Roach private $surname_tradition; 30323788f4SGreg Roach 31323788f4SGreg Roach /** 32323788f4SGreg Roach * Prepare the environment for these tests 3352348eb8SGreg Roach * 3452348eb8SGreg Roach * @return void 35323788f4SGreg Roach */ 36c1010edaSGreg Roach public function setUp() 37c1010edaSGreg Roach { 38323788f4SGreg Roach $this->surname_tradition = new LithuanianSurnameTradition; 39323788f4SGreg Roach } 40323788f4SGreg Roach 41323788f4SGreg Roach /** 42323788f4SGreg Roach * Test whether married surnames are used 4317d74f3aSGreg Roach * 4415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 4515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 4652348eb8SGreg Roach * 4752348eb8SGreg Roach * @return void 48323788f4SGreg Roach */ 49c1010edaSGreg Roach public function testMarriedSurnames() 50c1010edaSGreg Roach { 51323788f4SGreg Roach $this->assertSame(true, $this->surname_tradition->hasMarriedNames()); 52323788f4SGreg Roach } 53323788f4SGreg Roach 54323788f4SGreg Roach /** 55c1ec7145SGreg Roach * Test whether surnames are used 5617d74f3aSGreg Roach * 5715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 5815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 5952348eb8SGreg Roach * 6052348eb8SGreg Roach * @return void 61c1ec7145SGreg Roach */ 62c1010edaSGreg Roach public function testSurnames() 63c1010edaSGreg Roach { 64c1ec7145SGreg Roach $this->assertSame(true, $this->surname_tradition->hasSurnames()); 65c1ec7145SGreg Roach } 66c1ec7145SGreg Roach 67c1ec7145SGreg Roach /** 68323788f4SGreg Roach * Test new son names 6917d74f3aSGreg Roach * 7015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 7115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 7252348eb8SGreg Roach * 7352348eb8SGreg Roach * @return void 74323788f4SGreg Roach */ 75c1010edaSGreg Roach public function testNewSonNames() 76c1010edaSGreg Roach { 77323788f4SGreg Roach $this->assertSame( 78c1010edaSGreg Roach [ 79c1010edaSGreg Roach 'NAME' => '/White/', 80c1010edaSGreg Roach 'SURN' => 'White', 81c1010edaSGreg Roach ], 82323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M') 83323788f4SGreg Roach ); 84323788f4SGreg Roach } 85323788f4SGreg Roach 86323788f4SGreg Roach /** 87323788f4SGreg Roach * Test new daughter names 8817d74f3aSGreg Roach * 8915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 9015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 9152348eb8SGreg Roach * 9252348eb8SGreg Roach * @return void 93323788f4SGreg Roach */ 94c1010edaSGreg Roach public function testNewDaughterNames() 95c1010edaSGreg Roach { 96323788f4SGreg Roach $this->assertSame( 97c1010edaSGreg Roach [ 98c1010edaSGreg Roach 'NAME' => '/White/', 99c1010edaSGreg Roach 'SURN' => 'White', 100c1010edaSGreg Roach ], 101323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F') 102323788f4SGreg Roach ); 103323788f4SGreg Roach } 104323788f4SGreg Roach 105323788f4SGreg Roach /** 106323788f4SGreg Roach * Test new daughter names 10717d74f3aSGreg Roach * 10815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 10915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 11052348eb8SGreg Roach * 11152348eb8SGreg Roach * @return void 112323788f4SGreg Roach */ 113c1010edaSGreg Roach public function testNewDaughterNamesInflected() 114c1010edaSGreg Roach { 115323788f4SGreg Roach $this->assertSame( 116c1010edaSGreg Roach [ 117c1010edaSGreg Roach 'NAME' => '/Whitaitė/', 118c1010edaSGreg Roach 'SURN' => 'Whita', 119c1010edaSGreg Roach ], 120323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F') 121323788f4SGreg Roach ); 122323788f4SGreg Roach $this->assertSame( 123c1010edaSGreg Roach [ 124c1010edaSGreg Roach 'NAME' => '/Whitaitė/', 125c1010edaSGreg Roach 'SURN' => 'Whitas', 126c1010edaSGreg Roach ], 127323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F') 128323788f4SGreg Roach ); 129323788f4SGreg Roach $this->assertSame( 130c1010edaSGreg Roach [ 131c1010edaSGreg Roach 'NAME' => '/Whitytė/', 132c1010edaSGreg Roach 'SURN' => 'Whitis', 133c1010edaSGreg Roach ], 134323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F') 135323788f4SGreg Roach ); 136323788f4SGreg Roach $this->assertSame( 137c1010edaSGreg Roach [ 138c1010edaSGreg Roach 'NAME' => '/Whitytė/', 139c1010edaSGreg Roach 'SURN' => 'Whitys', 140c1010edaSGreg Roach ], 141323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F') 142323788f4SGreg Roach ); 143323788f4SGreg Roach $this->assertSame( 144c1010edaSGreg Roach [ 145c1010edaSGreg Roach 'NAME' => '/Whitiūtė/', 146c1010edaSGreg Roach 'SURN' => 'Whitius', 147c1010edaSGreg Roach ], 148323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F') 149323788f4SGreg Roach ); 150323788f4SGreg Roach $this->assertSame( 151c1010edaSGreg Roach [ 152c1010edaSGreg Roach 'NAME' => '/Whitutė/', 153c1010edaSGreg Roach 'SURN' => 'Whitus', 154c1010edaSGreg Roach ], 155323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F') 156323788f4SGreg Roach ); 157323788f4SGreg Roach } 158323788f4SGreg Roach 159323788f4SGreg Roach /** 160323788f4SGreg Roach * Test new child names 16117d74f3aSGreg Roach * 16215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 16315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 16452348eb8SGreg Roach * 16552348eb8SGreg Roach * @return void 166323788f4SGreg Roach */ 167c1010edaSGreg Roach public function testNewChildNames() 168c1010edaSGreg Roach { 169323788f4SGreg Roach $this->assertSame( 170c1010edaSGreg Roach [ 171c1010edaSGreg Roach 'NAME' => '/White/', 172c1010edaSGreg Roach 'SURN' => 'White', 173c1010edaSGreg Roach ], 174323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U') 175323788f4SGreg Roach ); 176323788f4SGreg Roach } 177323788f4SGreg Roach 178323788f4SGreg Roach /** 1791677a03aSGreg Roach * Test new child names 18017d74f3aSGreg Roach * 18115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 18215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 18352348eb8SGreg Roach * 18452348eb8SGreg Roach * @return void 1851677a03aSGreg Roach */ 186c1010edaSGreg Roach public function testNewChildNamesWithNoParentsNames() 187c1010edaSGreg Roach { 1881677a03aSGreg Roach $this->assertSame( 18913abd6f3SGreg Roach ['NAME' => '//'], 1901677a03aSGreg Roach $this->surname_tradition->newChildNames('', '', 'U') 1911677a03aSGreg Roach ); 1921677a03aSGreg Roach } 1931677a03aSGreg Roach 1941677a03aSGreg Roach /** 195323788f4SGreg Roach * Test new father names 19617d74f3aSGreg Roach * 19715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 19815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 19952348eb8SGreg Roach * 20052348eb8SGreg Roach * @return void 201323788f4SGreg Roach */ 202c1010edaSGreg Roach public function testNewFatherNames() 203c1010edaSGreg Roach { 204323788f4SGreg Roach $this->assertSame( 205c1010edaSGreg Roach [ 206c1010edaSGreg Roach 'NAME' => '/White/', 207c1010edaSGreg Roach 'SURN' => 'White', 208c1010edaSGreg Roach ], 209323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'M') 210323788f4SGreg Roach ); 211323788f4SGreg Roach } 212323788f4SGreg Roach 213323788f4SGreg Roach /** 214323788f4SGreg Roach * Test new father names 21517d74f3aSGreg Roach * 21615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 21715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 21852348eb8SGreg Roach * 21952348eb8SGreg Roach * @return void 220323788f4SGreg Roach */ 221c1010edaSGreg Roach public function testNewFatherNamesInflected() 222c1010edaSGreg Roach { 223323788f4SGreg Roach $this->assertSame( 224c1010edaSGreg Roach [ 225c1010edaSGreg Roach 'NAME' => '/Whitas/', 226c1010edaSGreg Roach 'SURN' => 'Whitas', 227c1010edaSGreg Roach ], 228323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M') 229323788f4SGreg Roach ); 230323788f4SGreg Roach $this->assertSame( 231c1010edaSGreg Roach [ 232c1010edaSGreg Roach 'NAME' => '/Whitis/', 233c1010edaSGreg Roach 'SURN' => 'Whitis', 234c1010edaSGreg Roach ], 235323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitytė/', 'M') 236323788f4SGreg Roach ); 237323788f4SGreg Roach $this->assertSame( 238c1010edaSGreg Roach [ 239c1010edaSGreg Roach 'NAME' => '/Whitius/', 240c1010edaSGreg Roach 'SURN' => 'Whitius', 241c1010edaSGreg Roach ], 242323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M') 243323788f4SGreg Roach ); 244323788f4SGreg Roach $this->assertSame( 245c1010edaSGreg Roach [ 246c1010edaSGreg Roach 'NAME' => '/Whitus/', 247c1010edaSGreg Roach 'SURN' => 'Whitus', 248c1010edaSGreg Roach ], 249323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitutė/', 'M') 250323788f4SGreg Roach ); 251323788f4SGreg Roach } 252323788f4SGreg Roach 253323788f4SGreg Roach /** 254323788f4SGreg Roach * Test new mother names 25517d74f3aSGreg Roach * 25615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 25715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 25852348eb8SGreg Roach * 25952348eb8SGreg Roach * @return void 260323788f4SGreg Roach */ 261c1010edaSGreg Roach public function testNewMotherNames() 262c1010edaSGreg Roach { 263323788f4SGreg Roach $this->assertSame( 26413abd6f3SGreg Roach ['NAME' => '//'], 265323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'F') 266323788f4SGreg Roach ); 267323788f4SGreg Roach } 268323788f4SGreg Roach 269323788f4SGreg Roach /** 270323788f4SGreg Roach * Test new parent names 27117d74f3aSGreg Roach * 27215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 27315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 27452348eb8SGreg Roach * 27552348eb8SGreg Roach * @return void 276323788f4SGreg Roach */ 277c1010edaSGreg Roach public function testNewParentNames() 278c1010edaSGreg Roach { 279323788f4SGreg Roach $this->assertSame( 28013abd6f3SGreg Roach ['NAME' => '//'], 281323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'U') 282323788f4SGreg Roach ); 283323788f4SGreg Roach } 284323788f4SGreg Roach 285323788f4SGreg Roach /** 286323788f4SGreg Roach * Test new husband names 28717d74f3aSGreg Roach * 28815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 28915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 29052348eb8SGreg Roach * 29152348eb8SGreg Roach * @return void 292323788f4SGreg Roach */ 293c1010edaSGreg Roach public function testNewHusbandNames() 294c1010edaSGreg Roach { 295323788f4SGreg Roach $this->assertSame( 29613abd6f3SGreg Roach ['NAME' => '//'], 297323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Mary /Black/', 'M') 298323788f4SGreg Roach ); 299323788f4SGreg Roach } 300323788f4SGreg Roach 301323788f4SGreg Roach /** 302323788f4SGreg Roach * Test new wife names 30317d74f3aSGreg Roach * 30415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 30515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 30652348eb8SGreg Roach * 30752348eb8SGreg Roach * @return void 308323788f4SGreg Roach */ 309c1010edaSGreg Roach public function testNewWifeNames() 310c1010edaSGreg Roach { 311323788f4SGreg Roach $this->assertSame( 312c1010edaSGreg Roach [ 313c1010edaSGreg Roach 'NAME' => '//', 314c1010edaSGreg Roach '_MARNM' => '/White/', 315c1010edaSGreg Roach ], 316323788f4SGreg Roach $this->surname_tradition->newSpouseNames('John /White/', 'F') 317323788f4SGreg Roach ); 318323788f4SGreg Roach } 319323788f4SGreg Roach 320323788f4SGreg Roach /** 321323788f4SGreg Roach * Test new spouse names 32217d74f3aSGreg Roach * 32315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 32415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 32552348eb8SGreg Roach * 32652348eb8SGreg Roach * @return void 327323788f4SGreg Roach */ 328c1010edaSGreg Roach public function testNewSpouseNames() 329c1010edaSGreg Roach { 330323788f4SGreg Roach $this->assertSame( 33113abd6f3SGreg Roach ['NAME' => '//'], 332323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Chris /Green/', 'U') 333323788f4SGreg Roach ); 334323788f4SGreg Roach } 335323788f4SGreg Roach} 336