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*e7f56f2aSGreg Roachdeclare(strict_types=1); 17*e7f56f2aSGreg Roach 1884e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition; 19c1010edaSGreg Roach 20323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition; 21323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface; 22323788f4SGreg Roach 23323788f4SGreg Roach/** 24323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition 25323788f4SGreg Roach */ 2684e2cf4eSGreg Roachclass IcelandicSurnameTraditionTest extends \Fisharebest\Webtrees\TestCase 27c1010edaSGreg Roach{ 28323788f4SGreg Roach /** @var SurnameTraditionInterface */ 29323788f4SGreg Roach private $surname_tradition; 30323788f4SGreg Roach 31323788f4SGreg Roach /** 32323788f4SGreg Roach * Prepare the environment for these tests 3352348eb8SGreg Roach * 3452348eb8SGreg Roach * @return void 35323788f4SGreg Roach */ 36c1010edaSGreg Roach public function setUp() 37c1010edaSGreg Roach { 38323788f4SGreg Roach $this->surname_tradition = new IcelandicSurnameTradition; 39323788f4SGreg Roach } 40323788f4SGreg Roach 41323788f4SGreg Roach /** 42323788f4SGreg Roach * Test whether married surnames are used 4317d74f3aSGreg Roach * 4415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 4552348eb8SGreg Roach * 4652348eb8SGreg Roach * @return void 47323788f4SGreg Roach */ 48c1010edaSGreg Roach public function testMarriedSurnames() 49c1010edaSGreg Roach { 50323788f4SGreg Roach $this->assertSame(false, $this->surname_tradition->hasMarriedNames()); 51323788f4SGreg Roach } 52323788f4SGreg Roach 53323788f4SGreg Roach /** 54c1ec7145SGreg Roach * Test whether surnames are used 5517d74f3aSGreg Roach * 5615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 5752348eb8SGreg Roach * 5852348eb8SGreg Roach * @return void 59c1ec7145SGreg Roach */ 60c1010edaSGreg Roach public function testSurnames() 61c1010edaSGreg Roach { 62c1ec7145SGreg Roach $this->assertSame(false, $this->surname_tradition->hasSurnames()); 63c1ec7145SGreg Roach } 64c1ec7145SGreg Roach 65c1ec7145SGreg Roach /** 66323788f4SGreg Roach * Test new son names 6717d74f3aSGreg Roach * 6815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 6952348eb8SGreg Roach * 7052348eb8SGreg Roach * @return void 71323788f4SGreg Roach */ 72c1010edaSGreg Roach public function testNewSonNames() 73c1010edaSGreg Roach { 74323788f4SGreg Roach $this->assertSame( 7513abd6f3SGreg Roach ['NAME' => 'Jonsson'], 76323788f4SGreg Roach $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M') 77323788f4SGreg Roach ); 78323788f4SGreg Roach } 79323788f4SGreg Roach 80323788f4SGreg Roach /** 81323788f4SGreg Roach * Test new daughter names 8217d74f3aSGreg Roach * 8315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 8452348eb8SGreg Roach * 8552348eb8SGreg Roach * @return void 86323788f4SGreg Roach */ 87c1010edaSGreg Roach public function testNewDaughterNames() 88c1010edaSGreg Roach { 89323788f4SGreg Roach $this->assertSame( 9013abd6f3SGreg Roach ['NAME' => 'Jonsdottir'], 91323788f4SGreg Roach $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F') 92323788f4SGreg Roach ); 93323788f4SGreg Roach } 94323788f4SGreg Roach 95323788f4SGreg Roach /** 96323788f4SGreg Roach * Test new child names 9717d74f3aSGreg Roach * 9815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 9952348eb8SGreg Roach * 10052348eb8SGreg Roach * @return void 101323788f4SGreg Roach */ 102c1010edaSGreg Roach public function testNewChildNames() 103c1010edaSGreg Roach { 104323788f4SGreg Roach $this->assertSame( 10513abd6f3SGreg Roach [], 106323788f4SGreg Roach $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U') 107323788f4SGreg Roach ); 108323788f4SGreg Roach } 109323788f4SGreg Roach 110323788f4SGreg Roach /** 111323788f4SGreg Roach * Test new father names 11217d74f3aSGreg Roach * 11315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 11452348eb8SGreg Roach * 11552348eb8SGreg Roach * @return void 116323788f4SGreg Roach */ 117c1010edaSGreg Roach public function testNewFatherNames() 118c1010edaSGreg Roach { 119323788f4SGreg Roach $this->assertSame( 120c1010edaSGreg Roach [ 121c1010edaSGreg Roach 'NAME' => 'Einar', 122c1010edaSGreg Roach 'GIVN' => 'Einar', 123c1010edaSGreg Roach ], 124323788f4SGreg Roach $this->surname_tradition->newParentNames('Jon Einarsson', 'M') 125323788f4SGreg Roach ); 126323788f4SGreg Roach } 127323788f4SGreg Roach 128323788f4SGreg Roach /** 129323788f4SGreg Roach * Test new mother names 13017d74f3aSGreg Roach * 13115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 13252348eb8SGreg Roach * 13352348eb8SGreg Roach * @return void 134323788f4SGreg Roach */ 135c1010edaSGreg Roach public function testNewMotherNames() 136c1010edaSGreg Roach { 137323788f4SGreg Roach $this->assertSame( 13813abd6f3SGreg Roach [], 139323788f4SGreg Roach $this->surname_tradition->newParentNames('Jon Einarsson', 'F') 140323788f4SGreg Roach ); 141323788f4SGreg Roach } 142323788f4SGreg Roach 143323788f4SGreg Roach /** 144323788f4SGreg Roach * Test new parent names 14517d74f3aSGreg Roach * 14615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 14752348eb8SGreg Roach * 14852348eb8SGreg Roach * @return void 149323788f4SGreg Roach */ 150c1010edaSGreg Roach public function testNewParentNames() 151c1010edaSGreg Roach { 152323788f4SGreg Roach $this->assertSame( 15313abd6f3SGreg Roach [], 154323788f4SGreg Roach $this->surname_tradition->newParentNames('Jon Einarsson', 'U') 155323788f4SGreg Roach ); 156323788f4SGreg Roach } 157323788f4SGreg Roach 158323788f4SGreg Roach /** 159323788f4SGreg Roach * Test new husband names 16017d74f3aSGreg Roach * 16115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 16252348eb8SGreg Roach * 16352348eb8SGreg Roach * @return void 164323788f4SGreg Roach */ 165c1010edaSGreg Roach public function testNewHusbandNames() 166c1010edaSGreg Roach { 167323788f4SGreg Roach $this->assertSame( 16813abd6f3SGreg Roach [], 169323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M') 170323788f4SGreg Roach ); 171323788f4SGreg Roach } 172323788f4SGreg Roach 173323788f4SGreg Roach /** 174323788f4SGreg Roach * Test new wife names 17517d74f3aSGreg Roach * 17615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 17752348eb8SGreg Roach * 17852348eb8SGreg Roach * @return void 179323788f4SGreg Roach */ 180c1010edaSGreg Roach public function testNewWifeNames() 181c1010edaSGreg Roach { 182323788f4SGreg Roach $this->assertSame( 18313abd6f3SGreg Roach [], 184323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Jon Einarsson', 'F') 185323788f4SGreg Roach ); 186323788f4SGreg Roach } 187323788f4SGreg Roach 188323788f4SGreg Roach /** 189323788f4SGreg Roach * Test new spouse names 19017d74f3aSGreg Roach * 19115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 19252348eb8SGreg Roach * 19352348eb8SGreg Roach * @return void 194323788f4SGreg Roach */ 195c1010edaSGreg Roach public function testNewSpouseNames() 196c1010edaSGreg Roach { 197323788f4SGreg Roach $this->assertSame( 19813abd6f3SGreg Roach [], 199323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Jon Einarsson', 'U') 200323788f4SGreg Roach ); 201323788f4SGreg Roach } 202323788f4SGreg Roach} 203