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*84e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition; 17c1010edaSGreg Roach 18323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition; 19323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface; 20323788f4SGreg Roach 21323788f4SGreg Roach/** 22323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition 23323788f4SGreg Roach */ 24*84e2cf4eSGreg Roachclass PolishSurnameTraditionTest extends \Fisharebest\Webtrees\TestCase 25c1010edaSGreg Roach{ 26323788f4SGreg Roach /** @var SurnameTraditionInterface */ 27323788f4SGreg Roach private $surname_tradition; 28323788f4SGreg Roach 29323788f4SGreg Roach /** 30323788f4SGreg Roach * Prepare the environment for these tests 31323788f4SGreg Roach */ 32c1010edaSGreg Roach public function setUp() 33c1010edaSGreg Roach { 34323788f4SGreg Roach $this->surname_tradition = new PolishSurnameTradition; 35323788f4SGreg Roach } 36323788f4SGreg Roach 37323788f4SGreg Roach /** 38323788f4SGreg Roach * Test whether married surnames are used 3917d74f3aSGreg Roach * 4015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 4115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 42323788f4SGreg Roach */ 43c1010edaSGreg Roach public function testMarriedSurnames() 44c1010edaSGreg Roach { 45323788f4SGreg Roach $this->assertSame(true, $this->surname_tradition->hasMarriedNames()); 46323788f4SGreg Roach } 47323788f4SGreg Roach 48323788f4SGreg Roach /** 49c1ec7145SGreg Roach * Test whether surnames are used 5017d74f3aSGreg Roach * 5115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 5215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 53c1ec7145SGreg Roach */ 54c1010edaSGreg Roach public function testSurnames() 55c1010edaSGreg Roach { 56c1ec7145SGreg Roach $this->assertSame(true, $this->surname_tradition->hasSurnames()); 57c1ec7145SGreg Roach } 58c1ec7145SGreg Roach 59c1ec7145SGreg Roach /** 60323788f4SGreg Roach * Test new son names 6117d74f3aSGreg Roach * 6215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 6315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 64323788f4SGreg Roach */ 65c1010edaSGreg Roach public function testNewSonNames() 66c1010edaSGreg Roach { 67323788f4SGreg Roach $this->assertSame( 68c1010edaSGreg Roach [ 69c1010edaSGreg Roach 'NAME' => '/White/', 70c1010edaSGreg Roach 'SURN' => 'White', 71c1010edaSGreg Roach ], 72323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M') 73323788f4SGreg Roach ); 74323788f4SGreg Roach } 75323788f4SGreg Roach 76323788f4SGreg Roach /** 77323788f4SGreg Roach * Test new daughter names 7817d74f3aSGreg Roach * 7915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 8015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 81323788f4SGreg Roach */ 82c1010edaSGreg Roach public function testNewDaughterNames() 83c1010edaSGreg Roach { 84323788f4SGreg Roach $this->assertSame( 85c1010edaSGreg Roach [ 86c1010edaSGreg Roach 'NAME' => '/White/', 87c1010edaSGreg Roach 'SURN' => 'White', 88c1010edaSGreg Roach ], 89323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F') 90323788f4SGreg Roach ); 91323788f4SGreg Roach } 92323788f4SGreg Roach 93323788f4SGreg Roach /** 94323788f4SGreg Roach * Test new daughter names 9517d74f3aSGreg Roach * 9615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 9715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 98323788f4SGreg Roach */ 99c1010edaSGreg Roach public function testNewDaughterNamesInflected() 100c1010edaSGreg Roach { 101323788f4SGreg Roach $this->assertSame( 102c1010edaSGreg Roach [ 103c1010edaSGreg Roach 'NAME' => '/Whitecka/', 104c1010edaSGreg Roach 'SURN' => 'Whitecki', 105c1010edaSGreg Roach ], 106323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitecki/', 'Mary /Black/', 'F') 107323788f4SGreg Roach ); 108323788f4SGreg Roach $this->assertSame( 109c1010edaSGreg Roach [ 110c1010edaSGreg Roach 'NAME' => '/Whitedzka/', 111c1010edaSGreg Roach 'SURN' => 'Whitedzki', 112c1010edaSGreg Roach ], 113323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whitedzki/', 'Mary /Black/', 'F') 114323788f4SGreg Roach ); 115323788f4SGreg Roach $this->assertSame( 116c1010edaSGreg Roach [ 117c1010edaSGreg Roach 'NAME' => '/Whiteska/', 118c1010edaSGreg Roach 'SURN' => 'Whiteski', 119c1010edaSGreg Roach ], 120323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whiteski/', 'Mary /Black/', 'F') 121323788f4SGreg Roach ); 122323788f4SGreg Roach $this->assertSame( 123c1010edaSGreg Roach [ 124c1010edaSGreg Roach 'NAME' => '/Whiteżka/', 125c1010edaSGreg Roach 'SURN' => 'Whiteżki', 126c1010edaSGreg Roach ], 127323788f4SGreg Roach $this->surname_tradition->newChildNames('John /Whiteżki/', 'Mary /Black/', 'F') 128323788f4SGreg Roach ); 129323788f4SGreg Roach } 130323788f4SGreg Roach 131323788f4SGreg Roach /** 132323788f4SGreg Roach * Test new child names 13317d74f3aSGreg Roach * 13415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 13515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 136323788f4SGreg Roach */ 137c1010edaSGreg Roach public function testNewChildNames() 138c1010edaSGreg Roach { 139323788f4SGreg Roach $this->assertSame( 140c1010edaSGreg Roach [ 141c1010edaSGreg Roach 'NAME' => '/White/', 142c1010edaSGreg Roach 'SURN' => 'White', 143c1010edaSGreg Roach ], 144323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U') 145323788f4SGreg Roach ); 146323788f4SGreg Roach } 147323788f4SGreg Roach 148323788f4SGreg Roach /** 1491677a03aSGreg Roach * Test new child names 15017d74f3aSGreg Roach * 15115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 15215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 1531677a03aSGreg Roach */ 154c1010edaSGreg Roach public function testNewChildNamesWithNoParentsNames() 155c1010edaSGreg Roach { 1561677a03aSGreg Roach $this->assertSame( 15713abd6f3SGreg Roach ['NAME' => '//'], 1581677a03aSGreg Roach $this->surname_tradition->newChildNames('', '', 'U') 1591677a03aSGreg Roach ); 1601677a03aSGreg Roach } 1611677a03aSGreg Roach 1621677a03aSGreg Roach /** 163323788f4SGreg Roach * Test new father names 16417d74f3aSGreg Roach * 16515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 16615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 167323788f4SGreg Roach */ 168c1010edaSGreg Roach public function testNewFatherNames() 169c1010edaSGreg Roach { 170323788f4SGreg Roach $this->assertSame( 171c1010edaSGreg Roach [ 172c1010edaSGreg Roach 'NAME' => '/White/', 173c1010edaSGreg Roach 'SURN' => 'White', 174c1010edaSGreg Roach ], 175323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'M') 176323788f4SGreg Roach ); 177323788f4SGreg Roach } 178323788f4SGreg Roach 179323788f4SGreg Roach /** 180323788f4SGreg Roach * Test new father names 18117d74f3aSGreg Roach * 18215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 18315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 184323788f4SGreg Roach */ 185c1010edaSGreg Roach public function testNewFatherNamesInflected() 186c1010edaSGreg Roach { 187323788f4SGreg Roach $this->assertSame( 188c1010edaSGreg Roach [ 189c1010edaSGreg Roach 'NAME' => '/Whitecki/', 190c1010edaSGreg Roach 'SURN' => 'Whitecki', 191c1010edaSGreg Roach ], 192323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitecka/', 'M') 193323788f4SGreg Roach ); 194323788f4SGreg Roach $this->assertSame( 195c1010edaSGreg Roach [ 196c1010edaSGreg Roach 'NAME' => '/Whitedzki/', 197c1010edaSGreg Roach 'SURN' => 'Whitedzki', 198c1010edaSGreg Roach ], 199323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whitedzka/', 'M') 200323788f4SGreg Roach ); 201323788f4SGreg Roach $this->assertSame( 202c1010edaSGreg Roach [ 203c1010edaSGreg Roach 'NAME' => '/Whiteski/', 204c1010edaSGreg Roach 'SURN' => 'Whiteski', 205c1010edaSGreg Roach ], 206323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whiteska/', 'M') 207323788f4SGreg Roach ); 208323788f4SGreg Roach $this->assertSame( 209c1010edaSGreg Roach [ 210c1010edaSGreg Roach 'NAME' => '/Whiteżki/', 211c1010edaSGreg Roach 'SURN' => 'Whiteżki', 212c1010edaSGreg Roach ], 213323788f4SGreg Roach $this->surname_tradition->newParentNames('Mary /Whiteżka/', 'M') 214323788f4SGreg Roach ); 215323788f4SGreg Roach } 216323788f4SGreg Roach 217323788f4SGreg Roach /** 218323788f4SGreg Roach * Test new mother names 21917d74f3aSGreg Roach * 22015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 22115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 222323788f4SGreg Roach */ 223c1010edaSGreg Roach public function testNewMotherNames() 224c1010edaSGreg Roach { 225323788f4SGreg Roach $this->assertSame( 22613abd6f3SGreg Roach ['NAME' => '//'], 227323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'F') 228323788f4SGreg Roach ); 229323788f4SGreg Roach } 230323788f4SGreg Roach 231323788f4SGreg Roach /** 232323788f4SGreg Roach * Test new parent names 23317d74f3aSGreg Roach * 23415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 23515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 236323788f4SGreg Roach */ 237c1010edaSGreg Roach public function testNewParentNames() 238c1010edaSGreg Roach { 239323788f4SGreg Roach $this->assertSame( 24013abd6f3SGreg Roach ['NAME' => '//'], 241323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'U') 242323788f4SGreg Roach ); 243323788f4SGreg Roach } 244323788f4SGreg Roach 245323788f4SGreg Roach /** 246323788f4SGreg Roach * Test new husband names 24717d74f3aSGreg Roach * 24815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 24915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 250323788f4SGreg Roach */ 251c1010edaSGreg Roach public function testNewHusbandNames() 252c1010edaSGreg Roach { 253323788f4SGreg Roach $this->assertSame( 25413abd6f3SGreg Roach ['NAME' => '//'], 255323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Mary /Black/', 'M') 256323788f4SGreg Roach ); 257323788f4SGreg Roach } 258323788f4SGreg Roach 259323788f4SGreg Roach /** 260323788f4SGreg Roach * Test new wife names 26117d74f3aSGreg Roach * 26215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 26315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 264323788f4SGreg Roach */ 265c1010edaSGreg Roach public function testNewWifeNames() 266c1010edaSGreg Roach { 267323788f4SGreg Roach $this->assertSame( 268c1010edaSGreg Roach [ 269c1010edaSGreg Roach 'NAME' => '//', 270c1010edaSGreg Roach '_MARNM' => '/White/', 271c1010edaSGreg Roach ], 272323788f4SGreg Roach $this->surname_tradition->newSpouseNames('John /White/', 'F') 273323788f4SGreg Roach ); 274323788f4SGreg Roach } 275323788f4SGreg Roach 276323788f4SGreg Roach /** 277323788f4SGreg Roach * Test new spouse names 27817d74f3aSGreg Roach * 27915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition 28015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition 281323788f4SGreg Roach */ 282c1010edaSGreg Roach public function testNewSpouseNames() 283c1010edaSGreg Roach { 284323788f4SGreg Roach $this->assertSame( 28513abd6f3SGreg Roach ['NAME' => '//'], 286323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Chris /Green/', 'U') 287323788f4SGreg Roach ); 288323788f4SGreg Roach } 289323788f4SGreg Roach} 290