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\PolishSurnameTradition; 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 PolishSurnameTraditionTest 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 PolishSurnameTradition; 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' => '/Whitecka/', 'SURN' => 'Whitecki'), 67*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitecki/', 'Mary /Black/', 'F') 68*323788f4SGreg Roach ); 69*323788f4SGreg Roach $this->assertSame( 70*323788f4SGreg Roach array('NAME' => '/Whitedzka/', 'SURN' => 'Whitedzki'), 71*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitedzki/', 'Mary /Black/', 'F') 72*323788f4SGreg Roach ); 73*323788f4SGreg Roach $this->assertSame( 74*323788f4SGreg Roach array('NAME' => '/Whiteska/', 'SURN' => 'Whiteski'), 75*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whiteski/', 'Mary /Black/', 'F') 76*323788f4SGreg Roach ); 77*323788f4SGreg Roach $this->assertSame( 78*323788f4SGreg Roach array('NAME' => '/Whiteżka/', 'SURN' => 'Whiteżki'), 79*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whiteżki/', 'Mary /Black/', 'F') 80*323788f4SGreg Roach ); 81*323788f4SGreg Roach } 82*323788f4SGreg Roach 83*323788f4SGreg Roach /** 84*323788f4SGreg Roach * Test new child names 85*323788f4SGreg Roach */ 86*323788f4SGreg Roach public function testNewChildNames() { 87*323788f4SGreg Roach $this->assertSame( 88*323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 89*323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U') 90*323788f4SGreg Roach ); 91*323788f4SGreg Roach } 92*323788f4SGreg Roach 93*323788f4SGreg Roach /** 94*323788f4SGreg Roach * Test new father names 95*323788f4SGreg Roach */ 96*323788f4SGreg Roach public function testNewFatherNames() { 97*323788f4SGreg Roach $this->assertSame( 98*323788f4SGreg Roach array('NAME' => '/White/', 'SURN' => 'White'), 99*323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'M') 100*323788f4SGreg Roach ); 101*323788f4SGreg Roach } 102*323788f4SGreg Roach 103*323788f4SGreg Roach /** 104*323788f4SGreg Roach * Test new father names 105*323788f4SGreg Roach */ 106*323788f4SGreg Roach public function testNewFatherNamesInflected() { 107*323788f4SGreg Roach $this->assertSame( 108*323788f4SGreg Roach array('NAME' => '/Whitecki/', 'SURN' => 'Whitecki'), 109*323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitecka/', 'M') 110*323788f4SGreg Roach ); 111*323788f4SGreg Roach $this->assertSame( 112*323788f4SGreg Roach array('NAME' => '/Whitedzki/', 'SURN' => 'Whitedzki'), 113*323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitedzka/', 'M') 114*323788f4SGreg Roach ); 115*323788f4SGreg Roach $this->assertSame( 116*323788f4SGreg Roach array('NAME' => '/Whiteski/', 'SURN' => 'Whiteski'), 117*323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whiteska/', 'M') 118*323788f4SGreg Roach ); 119*323788f4SGreg Roach $this->assertSame( 120*323788f4SGreg Roach array('NAME' => '/Whiteżki/', 'SURN' => 'Whiteżki'), 121*323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whiteżka/', 'M') 122*323788f4SGreg Roach ); 123*323788f4SGreg Roach } 124*323788f4SGreg Roach 125*323788f4SGreg Roach /** 126*323788f4SGreg Roach * Test new mother names 127*323788f4SGreg Roach */ 128*323788f4SGreg Roach public function testNewMotherNames() { 129*323788f4SGreg Roach $this->assertSame( 130*323788f4SGreg Roach array('NAME' => '//'), 131*323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'F') 132*323788f4SGreg Roach ); 133*323788f4SGreg Roach } 134*323788f4SGreg Roach 135*323788f4SGreg Roach /** 136*323788f4SGreg Roach * Test new parent names 137*323788f4SGreg Roach */ 138*323788f4SGreg Roach public function testNewParentNames() { 139*323788f4SGreg Roach $this->assertSame( 140*323788f4SGreg Roach array('NAME' => '//'), 141*323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'U') 142*323788f4SGreg Roach ); 143*323788f4SGreg Roach } 144*323788f4SGreg Roach 145*323788f4SGreg Roach /** 146*323788f4SGreg Roach * Test new husband names 147*323788f4SGreg Roach */ 148*323788f4SGreg Roach public function testNewHusbandNames() { 149*323788f4SGreg Roach $this->assertSame( 150*323788f4SGreg Roach array('NAME' => '//'), 151*323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Mary /Black/', 'M') 152*323788f4SGreg Roach ); 153*323788f4SGreg Roach } 154*323788f4SGreg Roach 155*323788f4SGreg Roach /** 156*323788f4SGreg Roach * Test new wife names 157*323788f4SGreg Roach */ 158*323788f4SGreg Roach public function testNewWifeNames() { 159*323788f4SGreg Roach $this->assertSame( 160*323788f4SGreg Roach array('NAME' => '//', '_MARNM' => '/White/'), 161*323788f4SGreg Roach $this->surname_tradition->newSpouseNames('John /White/', 'F') 162*323788f4SGreg Roach ); 163*323788f4SGreg Roach } 164*323788f4SGreg Roach 165*323788f4SGreg Roach /** 166*323788f4SGreg Roach * Test new spouse names 167*323788f4SGreg Roach */ 168*323788f4SGreg Roach public function testNewSpouseNames() { 169*323788f4SGreg Roach $this->assertSame( 170*323788f4SGreg Roach array('NAME' => '//'), 171*323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Chris /Green/', 'U') 172*323788f4SGreg Roach ); 173*323788f4SGreg Roach } 174*323788f4SGreg Roach} 175