1323788f4SGreg Roach<?php 2323788f4SGreg Roach 3323788f4SGreg Roach/** 4323788f4SGreg Roach * webtrees: online genealogy 51062a142SGreg Roach * Copyright (C) 2018 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 */ 17*c1010edaSGreg Roach 18323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition; 19323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface; 20323788f4SGreg Roach 21323788f4SGreg Roach/** 22323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition 23323788f4SGreg Roach */ 24*c1010edaSGreg Roachclass IcelandicSurnameTraditionTest extends \PHPUnit\Framework\TestCase 25*c1010edaSGreg Roach{ 26323788f4SGreg Roach /** @var SurnameTraditionInterface */ 27323788f4SGreg Roach private $surname_tradition; 28323788f4SGreg Roach 29323788f4SGreg Roach /** 30323788f4SGreg Roach * Prepare the environment for these tests 31323788f4SGreg Roach */ 32*c1010edaSGreg Roach public function setUp() 33*c1010edaSGreg Roach { 34323788f4SGreg Roach $this->surname_tradition = new IcelandicSurnameTradition; 35323788f4SGreg Roach } 36323788f4SGreg Roach 37323788f4SGreg Roach /** 38323788f4SGreg Roach * Test whether married surnames are used 3917d74f3aSGreg Roach * 4015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 41323788f4SGreg Roach */ 42*c1010edaSGreg Roach public function testMarriedSurnames() 43*c1010edaSGreg Roach { 44323788f4SGreg Roach $this->assertSame(false, $this->surname_tradition->hasMarriedNames()); 45323788f4SGreg Roach } 46323788f4SGreg Roach 47323788f4SGreg Roach /** 48c1ec7145SGreg Roach * Test whether surnames are used 4917d74f3aSGreg Roach * 5015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 51c1ec7145SGreg Roach */ 52*c1010edaSGreg Roach public function testSurnames() 53*c1010edaSGreg Roach { 54c1ec7145SGreg Roach $this->assertSame(false, $this->surname_tradition->hasSurnames()); 55c1ec7145SGreg Roach } 56c1ec7145SGreg Roach 57c1ec7145SGreg Roach /** 58323788f4SGreg Roach * Test new son names 5917d74f3aSGreg Roach * 6015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 61323788f4SGreg Roach */ 62*c1010edaSGreg Roach public function testNewSonNames() 63*c1010edaSGreg Roach { 64323788f4SGreg Roach $this->assertSame( 6513abd6f3SGreg Roach ['NAME' => 'Jonsson'], 66323788f4SGreg Roach $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M') 67323788f4SGreg Roach ); 68323788f4SGreg Roach } 69323788f4SGreg Roach 70323788f4SGreg Roach /** 71323788f4SGreg Roach * Test new daughter names 7217d74f3aSGreg Roach * 7315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 74323788f4SGreg Roach */ 75*c1010edaSGreg Roach public function testNewDaughterNames() 76*c1010edaSGreg Roach { 77323788f4SGreg Roach $this->assertSame( 7813abd6f3SGreg Roach ['NAME' => 'Jonsdottir'], 79323788f4SGreg Roach $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F') 80323788f4SGreg Roach ); 81323788f4SGreg Roach } 82323788f4SGreg Roach 83323788f4SGreg Roach /** 84323788f4SGreg Roach * Test new child names 8517d74f3aSGreg Roach * 8615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 87323788f4SGreg Roach */ 88*c1010edaSGreg Roach public function testNewChildNames() 89*c1010edaSGreg Roach { 90323788f4SGreg Roach $this->assertSame( 9113abd6f3SGreg Roach [], 92323788f4SGreg Roach $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U') 93323788f4SGreg Roach ); 94323788f4SGreg Roach } 95323788f4SGreg Roach 96323788f4SGreg Roach /** 97323788f4SGreg Roach * Test new father names 9817d74f3aSGreg Roach * 9915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 100323788f4SGreg Roach */ 101*c1010edaSGreg Roach public function testNewFatherNames() 102*c1010edaSGreg Roach { 103323788f4SGreg Roach $this->assertSame( 104*c1010edaSGreg Roach [ 105*c1010edaSGreg Roach 'NAME' => 'Einar', 106*c1010edaSGreg Roach 'GIVN' => 'Einar', 107*c1010edaSGreg Roach ], 108323788f4SGreg Roach $this->surname_tradition->newParentNames('Jon Einarsson', 'M') 109323788f4SGreg Roach ); 110323788f4SGreg Roach } 111323788f4SGreg Roach 112323788f4SGreg Roach /** 113323788f4SGreg Roach * Test new mother names 11417d74f3aSGreg Roach * 11515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 116323788f4SGreg Roach */ 117*c1010edaSGreg Roach public function testNewMotherNames() 118*c1010edaSGreg Roach { 119323788f4SGreg Roach $this->assertSame( 12013abd6f3SGreg Roach [], 121323788f4SGreg Roach $this->surname_tradition->newParentNames('Jon Einarsson', 'F') 122323788f4SGreg Roach ); 123323788f4SGreg Roach } 124323788f4SGreg Roach 125323788f4SGreg Roach /** 126323788f4SGreg Roach * Test new parent names 12717d74f3aSGreg Roach * 12815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 129323788f4SGreg Roach */ 130*c1010edaSGreg Roach public function testNewParentNames() 131*c1010edaSGreg Roach { 132323788f4SGreg Roach $this->assertSame( 13313abd6f3SGreg Roach [], 134323788f4SGreg Roach $this->surname_tradition->newParentNames('Jon Einarsson', 'U') 135323788f4SGreg Roach ); 136323788f4SGreg Roach } 137323788f4SGreg Roach 138323788f4SGreg Roach /** 139323788f4SGreg Roach * Test new husband names 14017d74f3aSGreg Roach * 14115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 142323788f4SGreg Roach */ 143*c1010edaSGreg Roach public function testNewHusbandNames() 144*c1010edaSGreg Roach { 145323788f4SGreg Roach $this->assertSame( 14613abd6f3SGreg Roach [], 147323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M') 148323788f4SGreg Roach ); 149323788f4SGreg Roach } 150323788f4SGreg Roach 151323788f4SGreg Roach /** 152323788f4SGreg Roach * Test new wife names 15317d74f3aSGreg Roach * 15415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 155323788f4SGreg Roach */ 156*c1010edaSGreg Roach public function testNewWifeNames() 157*c1010edaSGreg Roach { 158323788f4SGreg Roach $this->assertSame( 15913abd6f3SGreg Roach [], 160323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Jon Einarsson', 'F') 161323788f4SGreg Roach ); 162323788f4SGreg Roach } 163323788f4SGreg Roach 164323788f4SGreg Roach /** 165323788f4SGreg Roach * Test new spouse names 16617d74f3aSGreg Roach * 16715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 168323788f4SGreg Roach */ 169*c1010edaSGreg Roach public function testNewSpouseNames() 170*c1010edaSGreg Roach { 171323788f4SGreg Roach $this->assertSame( 17213abd6f3SGreg Roach [], 173323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Jon Einarsson', 'U') 174323788f4SGreg Roach ); 175323788f4SGreg Roach } 176323788f4SGreg Roach} 177