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