1<?php 2 3/** 4 * webtrees: online genealogy 5 * Copyright (C) 2020 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 */ 17 18declare(strict_types=1); 19 20namespace Fisharebest\Webtrees\SurnameTradition; 21 22use Fisharebest\Webtrees\TestCase; 23 24/** 25 * Test harness for the class SpanishSurnameTradition 26 */ 27class IcelandicSurnameTraditionTest extends TestCase 28{ 29 /** @var SurnameTraditionInterface */ 30 private $surname_tradition; 31 32 /** 33 * Prepare the environment for these tests 34 * 35 * @return void 36 */ 37 protected function setUp(): void 38 { 39 parent::setUp(); 40 41 $this->surname_tradition = new IcelandicSurnameTradition(); 42 } 43 44 /** 45 * Test whether married surnames are used 46 * 47 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 48 * 49 * @return void 50 */ 51 public function testMarriedSurnames(): void 52 { 53 self::assertFalse($this->surname_tradition->hasMarriedNames()); 54 } 55 56 /** 57 * Test whether surnames are used 58 * 59 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 60 * 61 * @return void 62 */ 63 public function testSurnames(): void 64 { 65 self::assertFalse($this->surname_tradition->hasSurnames()); 66 } 67 68 /** 69 * Test new son names 70 * 71 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 72 * 73 * @return void 74 */ 75 public function testNewSonNames(): void 76 { 77 self::assertSame( 78 ['NAME' => 'Jonsson'], 79 $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M') 80 ); 81 } 82 83 /** 84 * Test new daughter names 85 * 86 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 87 * 88 * @return void 89 */ 90 public function testNewDaughterNames(): void 91 { 92 self::assertSame( 93 ['NAME' => 'Jonsdottir'], 94 $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F') 95 ); 96 } 97 98 /** 99 * Test new child names 100 * 101 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 102 * 103 * @return void 104 */ 105 public function testNewChildNames(): void 106 { 107 self::assertSame( 108 [], 109 $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U') 110 ); 111 } 112 113 /** 114 * Test new father names 115 * 116 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 117 * 118 * @return void 119 */ 120 public function testNewFatherNames(): void 121 { 122 self::assertSame( 123 [ 124 'NAME' => 'Einar', 125 'GIVN' => 'Einar', 126 ], 127 $this->surname_tradition->newParentNames('Jon Einarsson', 'M') 128 ); 129 } 130 131 /** 132 * Test new mother names 133 * 134 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 135 * 136 * @return void 137 */ 138 public function testNewMotherNames(): void 139 { 140 self::assertSame( 141 [], 142 $this->surname_tradition->newParentNames('Jon Einarsson', 'F') 143 ); 144 } 145 146 /** 147 * Test new parent names 148 * 149 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 150 * 151 * @return void 152 */ 153 public function testNewParentNames(): void 154 { 155 self::assertSame( 156 [], 157 $this->surname_tradition->newParentNames('Jon Einarsson', 'U') 158 ); 159 } 160 161 /** 162 * Test new husband names 163 * 164 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 165 * 166 * @return void 167 */ 168 public function testNewHusbandNames(): void 169 { 170 self::assertSame( 171 [], 172 $this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M') 173 ); 174 } 175 176 /** 177 * Test new wife names 178 * 179 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 180 * 181 * @return void 182 */ 183 public function testNewWifeNames(): void 184 { 185 self::assertSame( 186 [], 187 $this->surname_tradition->newSpouseNames('Jon Einarsson', 'F') 188 ); 189 } 190 191 /** 192 * Test new spouse names 193 * 194 * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 195 * 196 * @return void 197 */ 198 public function testNewSpouseNames(): void 199 { 200 self::assertSame( 201 [], 202 $this->surname_tradition->newSpouseNames('Jon Einarsson', 'U') 203 ); 204 } 205} 206