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\DefaultSurnameTradition; 19323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface; 20323788f4SGreg Roach 21323788f4SGreg Roach/** 2217d74f3aSGreg Roach * Test harness for the class DefaultSurnameTradition 23323788f4SGreg Roach */ 24*c1010edaSGreg Roachclass DefaultSurnameTraditionTest 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 DefaultSurnameTradition; 35323788f4SGreg Roach } 36323788f4SGreg Roach 37323788f4SGreg Roach /** 38323788f4SGreg Roach * Test whether married surnames are used 3917d74f3aSGreg Roach * 4015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 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\DefaultSurnameTradition 51c1ec7145SGreg Roach */ 52*c1010edaSGreg Roach public function testSurnames() 53*c1010edaSGreg Roach { 54c1ec7145SGreg Roach $this->assertSame(true, $this->surname_tradition->hasSurnames()); 55c1ec7145SGreg Roach } 56c1ec7145SGreg Roach 57c1ec7145SGreg Roach /** 58323788f4SGreg Roach * Test new son names 5917d74f3aSGreg Roach * 6015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 61323788f4SGreg Roach */ 62*c1010edaSGreg Roach public function testNewSonNames() 63*c1010edaSGreg Roach { 64323788f4SGreg Roach $this->assertSame( 6513abd6f3SGreg Roach ['NAME' => '//'], 66323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M') 67323788f4SGreg Roach ); 68323788f4SGreg Roach } 69323788f4SGreg Roach 70323788f4SGreg Roach /** 71323788f4SGreg Roach * Test new daughter names 7217d74f3aSGreg Roach * 7315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 74323788f4SGreg Roach */ 75*c1010edaSGreg Roach public function testNewDaughterNames() 76*c1010edaSGreg Roach { 77323788f4SGreg Roach $this->assertSame( 7813abd6f3SGreg Roach ['NAME' => '//'], 79323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F') 80323788f4SGreg Roach ); 81323788f4SGreg Roach } 82323788f4SGreg Roach 83323788f4SGreg Roach /** 84323788f4SGreg Roach * Test new child names 8517d74f3aSGreg Roach * 8615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 87323788f4SGreg Roach */ 88*c1010edaSGreg Roach public function testNewChildNames() 89*c1010edaSGreg Roach { 90323788f4SGreg Roach $this->assertSame( 9113abd6f3SGreg Roach ['NAME' => '//'], 92323788f4SGreg Roach $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U') 93323788f4SGreg Roach ); 94323788f4SGreg Roach } 95323788f4SGreg Roach 96323788f4SGreg Roach /** 97323788f4SGreg Roach * Test new father names 9817d74f3aSGreg Roach * 9915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 100323788f4SGreg Roach */ 101*c1010edaSGreg Roach public function testNewFatherNames() 102*c1010edaSGreg Roach { 103323788f4SGreg Roach $this->assertSame( 10413abd6f3SGreg Roach ['NAME' => '//'], 105323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'M') 106323788f4SGreg Roach ); 107323788f4SGreg Roach } 108323788f4SGreg Roach 109323788f4SGreg Roach /** 110323788f4SGreg Roach * Test new mother names 11117d74f3aSGreg Roach * 11215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 113323788f4SGreg Roach */ 114*c1010edaSGreg Roach public function testNewMotherNames() 115*c1010edaSGreg Roach { 116323788f4SGreg Roach $this->assertSame( 11713abd6f3SGreg Roach ['NAME' => '//'], 118323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'F') 119323788f4SGreg Roach ); 120323788f4SGreg Roach } 121323788f4SGreg Roach 122323788f4SGreg Roach /** 123323788f4SGreg Roach * Test new parent names 12417d74f3aSGreg Roach * 12515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 126323788f4SGreg Roach */ 127*c1010edaSGreg Roach public function testNewParentNames() 128*c1010edaSGreg Roach { 129323788f4SGreg Roach $this->assertSame( 13013abd6f3SGreg Roach ['NAME' => '//'], 131323788f4SGreg Roach $this->surname_tradition->newParentNames('John /White/', 'U') 132323788f4SGreg Roach ); 133323788f4SGreg Roach } 134323788f4SGreg Roach 135323788f4SGreg Roach /** 136323788f4SGreg Roach * Test new husband names 13717d74f3aSGreg Roach * 13815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 139323788f4SGreg Roach */ 140*c1010edaSGreg Roach public function testNewHusbandNames() 141*c1010edaSGreg Roach { 142323788f4SGreg Roach $this->assertSame( 14313abd6f3SGreg Roach ['NAME' => '//'], 144323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Mary /Black/', 'M') 145323788f4SGreg Roach ); 146323788f4SGreg Roach } 147323788f4SGreg Roach 148323788f4SGreg Roach /** 149323788f4SGreg Roach * Test new wife names 15017d74f3aSGreg Roach * 15115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 152323788f4SGreg Roach */ 153*c1010edaSGreg Roach public function testNewWifeNames() 154*c1010edaSGreg Roach { 155323788f4SGreg Roach $this->assertSame( 15613abd6f3SGreg Roach ['NAME' => '//'], 157323788f4SGreg Roach $this->surname_tradition->newSpouseNames('John /White/', 'F') 158323788f4SGreg Roach ); 159323788f4SGreg Roach } 160323788f4SGreg Roach 161323788f4SGreg Roach /** 162323788f4SGreg Roach * Test new spouse names 16317d74f3aSGreg Roach * 16415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition 165323788f4SGreg Roach */ 166*c1010edaSGreg Roach public function testNewSpouseNames() 167*c1010edaSGreg Roach { 168323788f4SGreg Roach $this->assertSame( 16913abd6f3SGreg Roach ['NAME' => '//'], 170323788f4SGreg Roach $this->surname_tradition->newSpouseNames('Chris /Green/', 'U') 171323788f4SGreg Roach ); 172323788f4SGreg Roach } 173323788f4SGreg Roach} 174