1323788f4SGreg Roach<?php 2323788f4SGreg Roach 3323788f4SGreg Roach/** 4323788f4SGreg Roach * webtrees: online genealogy 5323788f4SGreg Roach * Copyright (C) 2015 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 */ 17323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition; 18323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface; 19323788f4SGreg Roach 20323788f4SGreg Roach/** 21323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition 22323788f4SGreg Roach */ 23db7d25eeSGreg Roachclass LithuanianSurnameTraditionTest extends \PHPUnit_Framework_TestCase { 24323788f4SGreg Roach /** @var SurnameTraditionInterface */ 25323788f4SGreg Roach private $surname_tradition; 26323788f4SGreg Roach 27323788f4SGreg Roach /** 28323788f4SGreg Roach * Prepare the environment for these tests 29323788f4SGreg Roach */ 30323788f4SGreg Roach public function setUp() { 31323788f4SGreg Roach $this->surname_tradition = new LithuanianSurnameTradition; 32323788f4SGreg Roach } 33323788f4SGreg Roach 34323788f4SGreg Roach /** 35323788f4SGreg Roach * Test whether married surnames are used 36*17d74f3aSGreg Roach * 37*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 38323788f4SGreg Roach */ 39323788f4SGreg Roach public function testMarriedSurnames() { 40323788f4SGreg Roach $this->assertSame(true, $this->surname_tradition->hasMarriedNames()); 41323788f4SGreg Roach } 42323788f4SGreg Roach 43323788f4SGreg Roach /** 44c1ec7145SGreg Roach * Test whether surnames are used 45*17d74f3aSGreg Roach * 46*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 47c1ec7145SGreg Roach */ 48c1ec7145SGreg Roach public function testSurnames() { 49c1ec7145SGreg Roach $this->assertSame(true, $this->surname_tradition->hasSurnames()); 50c1ec7145SGreg Roach } 51c1ec7145SGreg Roach 52c1ec7145SGreg Roach /** 53323788f4SGreg Roach * Test new son names 54*17d74f3aSGreg Roach * 55*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 56323788f4SGreg Roach */ 57323788f4SGreg Roach public function testNewSonNames() { 58323788f4SGreg Roach $this->assertSame( 59323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 60323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M') 61323788f4SGreg Roach ); 62323788f4SGreg Roach } 63323788f4SGreg Roach 64323788f4SGreg Roach /** 65323788f4SGreg Roach * Test new daughter names 66*17d74f3aSGreg Roach * 67*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 68323788f4SGreg Roach */ 69323788f4SGreg Roach public function testNewDaughterNames() { 70323788f4SGreg Roach $this->assertSame( 71323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 72323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F') 73323788f4SGreg Roach ); 74323788f4SGreg Roach } 75323788f4SGreg Roach 76323788f4SGreg Roach /** 77323788f4SGreg Roach * Test new daughter names 78*17d74f3aSGreg Roach * 79*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 80323788f4SGreg Roach */ 81323788f4SGreg Roach public function testNewDaughterNamesInflected() { 82323788f4SGreg Roach $this->assertSame( 83323788f4SGreg Roach array('NAME' => '/Whitaitė/', 'SURN' => 'Whita'), 84323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F') 85323788f4SGreg Roach ); 86323788f4SGreg Roach $this->assertSame( 87323788f4SGreg Roach array('NAME' => '/Whitaitė/', 'SURN' => 'Whitas'), 88323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F') 89323788f4SGreg Roach ); 90323788f4SGreg Roach $this->assertSame( 91323788f4SGreg Roach array('NAME' => '/Whitytė/', 'SURN' => 'Whitis'), 92323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F') 93323788f4SGreg Roach ); 94323788f4SGreg Roach $this->assertSame( 95323788f4SGreg Roach array('NAME' => '/Whitytė/', 'SURN' => 'Whitys'), 96323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F') 97323788f4SGreg Roach ); 98323788f4SGreg Roach $this->assertSame( 99323788f4SGreg Roach array('NAME' => '/Whitiūtė/', 'SURN' => 'Whitius'), 100323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F') 101323788f4SGreg Roach ); 102323788f4SGreg Roach $this->assertSame( 103323788f4SGreg Roach array('NAME' => '/Whitutė/', 'SURN' => 'Whitus'), 104323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F') 105323788f4SGreg Roach ); 106323788f4SGreg Roach } 107323788f4SGreg Roach 108323788f4SGreg Roach /** 109323788f4SGreg Roach * Test new child names 110*17d74f3aSGreg Roach * 111*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 112323788f4SGreg Roach */ 113323788f4SGreg Roach public function testNewChildNames() { 114323788f4SGreg Roach $this->assertSame( 115323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 116323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U') 117323788f4SGreg Roach ); 118323788f4SGreg Roach } 119323788f4SGreg Roach 120323788f4SGreg Roach /** 1211677a03aSGreg Roach * Test new child names 122*17d74f3aSGreg Roach * 123*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 1241677a03aSGreg Roach */ 1251677a03aSGreg Roach public function testNewChildNamesWithNoParentsNames() { 1261677a03aSGreg Roach $this->assertSame( 1271677a03aSGreg Roach array('NAME' => '//'), 1281677a03aSGreg Roach $this->surname_tradition->newChildNames('', '', 'U') 1291677a03aSGreg Roach ); 1301677a03aSGreg Roach } 1311677a03aSGreg Roach 1321677a03aSGreg Roach /** 133323788f4SGreg Roach * Test new father names 134*17d74f3aSGreg Roach * 135*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 136323788f4SGreg Roach */ 137323788f4SGreg Roach public function testNewFatherNames() { 138323788f4SGreg Roach $this->assertSame( 139323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 140323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'M') 141323788f4SGreg Roach ); 142323788f4SGreg Roach } 143323788f4SGreg Roach 144323788f4SGreg Roach /** 145323788f4SGreg Roach * Test new father names 146*17d74f3aSGreg Roach * 147*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 148323788f4SGreg Roach */ 149323788f4SGreg Roach public function testNewFatherNamesInflected() { 150323788f4SGreg Roach $this->assertSame( 151323788f4SGreg Roach array('NAME' => '/Whitas/', 'SURN' => 'Whitas'), 152323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M') 153323788f4SGreg Roach ); 154323788f4SGreg Roach $this->assertSame( 155323788f4SGreg Roach array('NAME' => '/Whitis/', 'SURN' => 'Whitis'), 156323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitytė/', 'M') 157323788f4SGreg Roach ); 158323788f4SGreg Roach $this->assertSame( 159323788f4SGreg Roach array('NAME' => '/Whitius/', 'SURN' => 'Whitius'), 160323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M') 161323788f4SGreg Roach ); 162323788f4SGreg Roach $this->assertSame( 163323788f4SGreg Roach array('NAME' => '/Whitus/', 'SURN' => 'Whitus'), 164323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitutė/', 'M') 165323788f4SGreg Roach ); 166323788f4SGreg Roach } 167323788f4SGreg Roach 168323788f4SGreg Roach /** 169323788f4SGreg Roach * Test new mother names 170*17d74f3aSGreg Roach * 171*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 172323788f4SGreg Roach */ 173323788f4SGreg Roach public function testNewMotherNames() { 174323788f4SGreg Roach $this->assertSame( 175323788f4SGreg Roach array('NAME' => '//'), 176323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'F') 177323788f4SGreg Roach ); 178323788f4SGreg Roach } 179323788f4SGreg Roach 180323788f4SGreg Roach /** 181323788f4SGreg Roach * Test new parent names 182*17d74f3aSGreg Roach * 183*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 184323788f4SGreg Roach */ 185323788f4SGreg Roach public function testNewParentNames() { 186323788f4SGreg Roach $this->assertSame( 187323788f4SGreg Roach array('NAME' => '//'), 188323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'U') 189323788f4SGreg Roach ); 190323788f4SGreg Roach } 191323788f4SGreg Roach 192323788f4SGreg Roach /** 193323788f4SGreg Roach * Test new husband names 194*17d74f3aSGreg Roach * 195*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 196323788f4SGreg Roach */ 197323788f4SGreg Roach public function testNewHusbandNames() { 198323788f4SGreg Roach $this->assertSame( 199323788f4SGreg Roach array('NAME' => '//'), 200323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Mary /Black/', 'M') 201323788f4SGreg Roach ); 202323788f4SGreg Roach } 203323788f4SGreg Roach 204323788f4SGreg Roach /** 205323788f4SGreg Roach * Test new wife names 206*17d74f3aSGreg Roach * 207*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 208323788f4SGreg Roach */ 209323788f4SGreg Roach public function testNewWifeNames() { 210323788f4SGreg Roach $this->assertSame( 211323788f4SGreg Roach array('NAME' => '//', '_MARNM' => '/White/'), 212323788f4SGreg Roach $this->surname_tradition->newSpouseNames('John /White/', 'F') 213323788f4SGreg Roach ); 214323788f4SGreg Roach } 215323788f4SGreg Roach 216323788f4SGreg Roach /** 217323788f4SGreg Roach * Test new spouse names 218*17d74f3aSGreg Roach * 219*17d74f3aSGreg Roach * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition 220323788f4SGreg Roach */ 221323788f4SGreg Roach public function testNewSpouseNames() { 222323788f4SGreg Roach $this->assertSame( 223323788f4SGreg Roach array('NAME' => '//'), 224323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Chris /Green/', 'U') 225323788f4SGreg Roach ); 226323788f4SGreg Roach } 227323788f4SGreg Roach} 228