1323788f4SGreg Roach<?php 23976b470SGreg Roach 3323788f4SGreg Roach/** 4323788f4SGreg Roach * webtrees: online genealogy 589f7189bSGreg Roach * Copyright (C) 2021 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 1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>. 16323788f4SGreg Roach */ 17fcfa147eSGreg Roach 18e7f56f2aSGreg Roachdeclare(strict_types=1); 19e7f56f2aSGreg Roach 2084e2cf4eSGreg Roachnamespace Fisharebest\Webtrees\SurnameTradition; 21c1010edaSGreg Roach 223cfcc809SGreg Roachuse Fisharebest\Webtrees\TestCase; 233cfcc809SGreg Roach 24323788f4SGreg Roach/** 25*c4943cffSGreg Roach * Test harness for the class IcelandicSurnameTradition 26323788f4SGreg Roach */ 273cfcc809SGreg Roachclass IcelandicSurnameTraditionTest extends TestCase 28c1010edaSGreg Roach{ 29*c4943cffSGreg Roach private SurnameTraditionInterface $surname_tradition; 30323788f4SGreg Roach 31323788f4SGreg Roach /** 32323788f4SGreg Roach * Prepare the environment for these tests 3352348eb8SGreg Roach * 3452348eb8SGreg Roach * @return void 35323788f4SGreg Roach */ 365c48bcd6SGreg Roach protected function setUp(): void 37c1010edaSGreg Roach { 380115bc16SGreg Roach parent::setUp(); 390115bc16SGreg Roach 4074d6dc0eSGreg Roach $this->surname_tradition = new IcelandicSurnameTradition(); 41323788f4SGreg Roach } 42323788f4SGreg Roach 43323788f4SGreg Roach /** 44323788f4SGreg Roach * Test whether married surnames are used 4517d74f3aSGreg Roach * 4615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 4752348eb8SGreg Roach * 4852348eb8SGreg Roach * @return void 49323788f4SGreg Roach */ 509b802b22SGreg Roach public function testMarriedSurnames(): void 51c1010edaSGreg Roach { 525e933c21SGreg Roach self::assertFalse($this->surname_tradition->hasMarriedNames()); 53323788f4SGreg Roach } 54323788f4SGreg Roach 55323788f4SGreg Roach /** 56c1ec7145SGreg Roach * Test whether surnames are used 5717d74f3aSGreg Roach * 5815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 5952348eb8SGreg Roach * 6052348eb8SGreg Roach * @return void 61c1ec7145SGreg Roach */ 629b802b22SGreg Roach public function testSurnames(): void 63c1010edaSGreg Roach { 645e933c21SGreg Roach self::assertFalse($this->surname_tradition->hasSurnames()); 65c1ec7145SGreg Roach } 66c1ec7145SGreg Roach 67c1ec7145SGreg Roach /** 68323788f4SGreg Roach * Test new son names 6917d74f3aSGreg Roach * 7015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 7152348eb8SGreg Roach * 7252348eb8SGreg Roach * @return void 73323788f4SGreg Roach */ 749b802b22SGreg Roach public function testNewSonNames(): void 75c1010edaSGreg Roach { 765e933c21SGreg Roach self::assertSame( 7713abd6f3SGreg Roach ['NAME' => 'Jonsson'], 78323788f4SGreg Roach $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M') 79323788f4SGreg Roach ); 80323788f4SGreg Roach } 81323788f4SGreg Roach 82323788f4SGreg Roach /** 83323788f4SGreg Roach * Test new daughter names 8417d74f3aSGreg Roach * 8515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 8652348eb8SGreg Roach * 8752348eb8SGreg Roach * @return void 88323788f4SGreg Roach */ 899b802b22SGreg Roach public function testNewDaughterNames(): void 90c1010edaSGreg Roach { 915e933c21SGreg Roach self::assertSame( 9213abd6f3SGreg Roach ['NAME' => 'Jonsdottir'], 93323788f4SGreg Roach $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F') 94323788f4SGreg Roach ); 95323788f4SGreg Roach } 96323788f4SGreg Roach 97323788f4SGreg Roach /** 98323788f4SGreg Roach * Test new child names 9917d74f3aSGreg Roach * 10015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 10152348eb8SGreg Roach * 10252348eb8SGreg Roach * @return void 103323788f4SGreg Roach */ 1049b802b22SGreg Roach public function testNewChildNames(): void 105c1010edaSGreg Roach { 1065e933c21SGreg Roach self::assertSame( 10713abd6f3SGreg Roach [], 108323788f4SGreg Roach $this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U') 109323788f4SGreg Roach ); 110323788f4SGreg Roach } 111323788f4SGreg Roach 112323788f4SGreg Roach /** 113323788f4SGreg Roach * Test new father names 11417d74f3aSGreg Roach * 11515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 11652348eb8SGreg Roach * 11752348eb8SGreg Roach * @return void 118323788f4SGreg Roach */ 1199b802b22SGreg Roach public function testNewFatherNames(): void 120c1010edaSGreg Roach { 1215e933c21SGreg Roach self::assertSame( 122c1010edaSGreg Roach [ 123c1010edaSGreg Roach 'NAME' => 'Einar', 124c1010edaSGreg Roach 'GIVN' => 'Einar', 125c1010edaSGreg Roach ], 126323788f4SGreg Roach $this->surname_tradition->newParentNames('Jon Einarsson', 'M') 127323788f4SGreg Roach ); 128323788f4SGreg Roach } 129323788f4SGreg Roach 130323788f4SGreg Roach /** 131323788f4SGreg Roach * Test new mother names 13217d74f3aSGreg Roach * 13315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 13452348eb8SGreg Roach * 13552348eb8SGreg Roach * @return void 136323788f4SGreg Roach */ 1379b802b22SGreg Roach public function testNewMotherNames(): void 138c1010edaSGreg Roach { 1395e933c21SGreg Roach self::assertSame( 14013abd6f3SGreg Roach [], 141323788f4SGreg Roach $this->surname_tradition->newParentNames('Jon Einarsson', 'F') 142323788f4SGreg Roach ); 143323788f4SGreg Roach } 144323788f4SGreg Roach 145323788f4SGreg Roach /** 146323788f4SGreg Roach * Test new parent names 14717d74f3aSGreg Roach * 14815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 14952348eb8SGreg Roach * 15052348eb8SGreg Roach * @return void 151323788f4SGreg Roach */ 1529b802b22SGreg Roach public function testNewParentNames(): void 153c1010edaSGreg Roach { 1545e933c21SGreg Roach self::assertSame( 15513abd6f3SGreg Roach [], 156323788f4SGreg Roach $this->surname_tradition->newParentNames('Jon Einarsson', 'U') 157323788f4SGreg Roach ); 158323788f4SGreg Roach } 159323788f4SGreg Roach 160323788f4SGreg Roach /** 161323788f4SGreg Roach * Test new husband names 16217d74f3aSGreg Roach * 16315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 16452348eb8SGreg Roach * 16552348eb8SGreg Roach * @return void 166323788f4SGreg Roach */ 1679b802b22SGreg Roach public function testNewHusbandNames(): void 168c1010edaSGreg Roach { 1695e933c21SGreg Roach self::assertSame( 17013abd6f3SGreg Roach [], 171323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M') 172323788f4SGreg Roach ); 173323788f4SGreg Roach } 174323788f4SGreg Roach 175323788f4SGreg Roach /** 176323788f4SGreg Roach * Test new wife names 17717d74f3aSGreg Roach * 17815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 17952348eb8SGreg Roach * 18052348eb8SGreg Roach * @return void 181323788f4SGreg Roach */ 1829b802b22SGreg Roach public function testNewWifeNames(): void 183c1010edaSGreg Roach { 1845e933c21SGreg Roach self::assertSame( 18513abd6f3SGreg Roach [], 186323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Jon Einarsson', 'F') 187323788f4SGreg Roach ); 188323788f4SGreg Roach } 189323788f4SGreg Roach 190323788f4SGreg Roach /** 191323788f4SGreg Roach * Test new spouse names 19217d74f3aSGreg Roach * 19315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition 19452348eb8SGreg Roach * 19552348eb8SGreg Roach * @return void 196323788f4SGreg Roach */ 1979b802b22SGreg Roach public function testNewSpouseNames(): void 198c1010edaSGreg Roach { 1995e933c21SGreg Roach self::assertSame( 20013abd6f3SGreg Roach [], 201323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Jon Einarsson', 'U') 202323788f4SGreg Roach ); 203323788f4SGreg Roach } 204323788f4SGreg Roach} 205