1*323788f4SGreg Roach<?php 2*323788f4SGreg Roach 3*323788f4SGreg Roach/** 4*323788f4SGreg Roach * webtrees: online genealogy 5*323788f4SGreg Roach * Copyright (C) 2015 webtrees development team 6*323788f4SGreg Roach * This program is free software: you can redistribute it and/or modify 7*323788f4SGreg Roach * it under the terms of the GNU General Public License as published by 8*323788f4SGreg Roach * the Free Software Foundation, either version 3 of the License, or 9*323788f4SGreg Roach * (at your option) any later version. 10*323788f4SGreg Roach * This program is distributed in the hope that it will be useful, 11*323788f4SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 12*323788f4SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13*323788f4SGreg Roach * GNU General Public License for more details. 14*323788f4SGreg Roach * You should have received a copy of the GNU General Public License 15*323788f4SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 16*323788f4SGreg Roach */ 17*323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition; 18*323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface; 19*323788f4SGreg Roach 20*323788f4SGreg Roach/** 21*323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition 22*323788f4SGreg Roach */ 23*323788f4SGreg Roachclass LithuanianSurnameTraditionTest extends PHPUnit_Framework_TestCase { 24*323788f4SGreg Roach /** @var SurnameTraditionInterface */ 25*323788f4SGreg Roach private $surname_tradition; 26*323788f4SGreg Roach 27*323788f4SGreg Roach /** 28*323788f4SGreg Roach * Prepare the environment for these tests 29*323788f4SGreg Roach */ 30*323788f4SGreg Roach public function setUp() { 31*323788f4SGreg Roach $this->surname_tradition = new LithuanianSurnameTradition; 32*323788f4SGreg Roach } 33*323788f4SGreg Roach 34*323788f4SGreg Roach /** 35*323788f4SGreg Roach * Test whether married surnames are used 36*323788f4SGreg Roach */ 37*323788f4SGreg Roach public function testMarriedSurnames() { 38*323788f4SGreg Roach $this->assertSame(true, $this->surname_tradition->hasMarriedNames()); 39*323788f4SGreg Roach } 40*323788f4SGreg Roach 41*323788f4SGreg Roach /** 42*323788f4SGreg Roach * Test new son names 43*323788f4SGreg Roach */ 44*323788f4SGreg Roach public function testNewSonNames() { 45*323788f4SGreg Roach $this->assertSame( 46*323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 47*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M') 48*323788f4SGreg Roach ); 49*323788f4SGreg Roach } 50*323788f4SGreg Roach 51*323788f4SGreg Roach /** 52*323788f4SGreg Roach * Test new daughter names 53*323788f4SGreg Roach */ 54*323788f4SGreg Roach public function testNewDaughterNames() { 55*323788f4SGreg Roach $this->assertSame( 56*323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 57*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F') 58*323788f4SGreg Roach ); 59*323788f4SGreg Roach } 60*323788f4SGreg Roach 61*323788f4SGreg Roach /** 62*323788f4SGreg Roach * Test new daughter names 63*323788f4SGreg Roach */ 64*323788f4SGreg Roach public function testNewDaughterNamesInflected() { 65*323788f4SGreg Roach $this->assertSame( 66*323788f4SGreg Roach array('NAME' => '/Whitaitė/', 'SURN' => 'Whita'), 67*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F') 68*323788f4SGreg Roach ); 69*323788f4SGreg Roach $this->assertSame( 70*323788f4SGreg Roach array('NAME' => '/Whitaitė/', 'SURN' => 'Whitas'), 71*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F') 72*323788f4SGreg Roach ); 73*323788f4SGreg Roach $this->assertSame( 74*323788f4SGreg Roach array('NAME' => '/Whitytė/', 'SURN' => 'Whitis'), 75*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F') 76*323788f4SGreg Roach ); 77*323788f4SGreg Roach $this->assertSame( 78*323788f4SGreg Roach array('NAME' => '/Whitytė/', 'SURN' => 'Whitys'), 79*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F') 80*323788f4SGreg Roach ); 81*323788f4SGreg Roach $this->assertSame( 82*323788f4SGreg Roach array('NAME' => '/Whitiūtė/', 'SURN' => 'Whitius'), 83*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F') 84*323788f4SGreg Roach ); 85*323788f4SGreg Roach $this->assertSame( 86*323788f4SGreg Roach array('NAME' => '/Whitutė/', 'SURN' => 'Whitus'), 87*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F') 88*323788f4SGreg Roach ); 89*323788f4SGreg Roach } 90*323788f4SGreg Roach 91*323788f4SGreg Roach /** 92*323788f4SGreg Roach * Test new child names 93*323788f4SGreg Roach */ 94*323788f4SGreg Roach public function testNewChildNames() { 95*323788f4SGreg Roach $this->assertSame( 96*323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 97*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U') 98*323788f4SGreg Roach ); 99*323788f4SGreg Roach } 100*323788f4SGreg Roach 101*323788f4SGreg Roach /** 102*323788f4SGreg Roach * Test new father names 103*323788f4SGreg Roach */ 104*323788f4SGreg Roach public function testNewFatherNames() { 105*323788f4SGreg Roach $this->assertSame( 106*323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 107*323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'M') 108*323788f4SGreg Roach ); 109*323788f4SGreg Roach } 110*323788f4SGreg Roach 111*323788f4SGreg Roach /** 112*323788f4SGreg Roach * Test new father names 113*323788f4SGreg Roach */ 114*323788f4SGreg Roach public function testNewFatherNamesInflected() { 115*323788f4SGreg Roach $this->assertSame( 116*323788f4SGreg Roach array('NAME' => '/Whitas/', 'SURN' => 'Whitas'), 117*323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M') 118*323788f4SGreg Roach ); 119*323788f4SGreg Roach $this->assertSame( 120*323788f4SGreg Roach array('NAME' => '/Whitis/', 'SURN' => 'Whitis'), 121*323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitytė/', 'M') 122*323788f4SGreg Roach ); 123*323788f4SGreg Roach $this->assertSame( 124*323788f4SGreg Roach array('NAME' => '/Whitius/', 'SURN' => 'Whitius'), 125*323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M') 126*323788f4SGreg Roach ); 127*323788f4SGreg Roach $this->assertSame( 128*323788f4SGreg Roach array('NAME' => '/Whitus/', 'SURN' => 'Whitus'), 129*323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitutė/', 'M') 130*323788f4SGreg Roach ); 131*323788f4SGreg Roach } 132*323788f4SGreg Roach 133*323788f4SGreg Roach /** 134*323788f4SGreg Roach * Test new mother names 135*323788f4SGreg Roach */ 136*323788f4SGreg Roach public function testNewMotherNames() { 137*323788f4SGreg Roach $this->assertSame( 138*323788f4SGreg Roach array('NAME' => '//'), 139*323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'F') 140*323788f4SGreg Roach ); 141*323788f4SGreg Roach } 142*323788f4SGreg Roach 143*323788f4SGreg Roach /** 144*323788f4SGreg Roach * Test new parent names 145*323788f4SGreg Roach */ 146*323788f4SGreg Roach public function testNewParentNames() { 147*323788f4SGreg Roach $this->assertSame( 148*323788f4SGreg Roach array('NAME' => '//'), 149*323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'U') 150*323788f4SGreg Roach ); 151*323788f4SGreg Roach } 152*323788f4SGreg Roach 153*323788f4SGreg Roach /** 154*323788f4SGreg Roach * Test new husband names 155*323788f4SGreg Roach */ 156*323788f4SGreg Roach public function testNewHusbandNames() { 157*323788f4SGreg Roach $this->assertSame( 158*323788f4SGreg Roach array('NAME' => '//'), 159*323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Mary /Black/', 'M') 160*323788f4SGreg Roach ); 161*323788f4SGreg Roach } 162*323788f4SGreg Roach 163*323788f4SGreg Roach /** 164*323788f4SGreg Roach * Test new wife names 165*323788f4SGreg Roach */ 166*323788f4SGreg Roach public function testNewWifeNames() { 167*323788f4SGreg Roach $this->assertSame( 168*323788f4SGreg Roach array('NAME' => '//', '_MARNM' => '/White/'), 169*323788f4SGreg Roach $this->surname_tradition->newSpouseNames('John /White/', 'F') 170*323788f4SGreg Roach ); 171*323788f4SGreg Roach } 172*323788f4SGreg Roach 173*323788f4SGreg Roach /** 174*323788f4SGreg Roach * Test new spouse names 175*323788f4SGreg Roach */ 176*323788f4SGreg Roach public function testNewSpouseNames() { 177*323788f4SGreg Roach $this->assertSame( 178*323788f4SGreg Roach array('NAME' => '//'), 179*323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Chris /Green/', 'U') 180*323788f4SGreg Roach ); 181*323788f4SGreg Roach } 182*323788f4SGreg Roach} 183