xref: /webtrees/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php (revision 323788f4145f5a5554b028e0581a6e2063364968)
1*323788f4SGreg Roach<?php
2*323788f4SGreg Roach
3*323788f4SGreg Roach/**
4*323788f4SGreg Roach * webtrees: online genealogy
5*323788f4SGreg Roach * Copyright (C) 2015 webtrees development team
6*323788f4SGreg Roach * This program is free software: you can redistribute it and/or modify
7*323788f4SGreg Roach * it under the terms of the GNU General Public License as published by
8*323788f4SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9*323788f4SGreg Roach * (at your option) any later version.
10*323788f4SGreg Roach * This program is distributed in the hope that it will be useful,
11*323788f4SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12*323788f4SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13*323788f4SGreg Roach * GNU General Public License for more details.
14*323788f4SGreg Roach * You should have received a copy of the GNU General Public License
15*323788f4SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
16*323788f4SGreg Roach */
17*323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition;
18*323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface;
19*323788f4SGreg Roach
20*323788f4SGreg Roach/**
21*323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition
22*323788f4SGreg Roach */
23*323788f4SGreg Roachclass IcelandicSurnameTraditionTest extends PHPUnit_Framework_TestCase {
24*323788f4SGreg Roach	/** @var SurnameTraditionInterface */
25*323788f4SGreg Roach	private $surname_tradition;
26*323788f4SGreg Roach
27*323788f4SGreg Roach	/**
28*323788f4SGreg Roach	 * Prepare the environment for these tests
29*323788f4SGreg Roach	 */
30*323788f4SGreg Roach	public function setUp() {
31*323788f4SGreg Roach		$this->surname_tradition = new IcelandicSurnameTradition;
32*323788f4SGreg Roach	}
33*323788f4SGreg Roach
34*323788f4SGreg Roach	/**
35*323788f4SGreg Roach	 * Test whether married surnames are used
36*323788f4SGreg Roach	 */
37*323788f4SGreg Roach	public function testMarriedSurnames() {
38*323788f4SGreg Roach		$this->assertSame(false, $this->surname_tradition->hasMarriedNames());
39*323788f4SGreg Roach	}
40*323788f4SGreg Roach
41*323788f4SGreg Roach	/**
42*323788f4SGreg Roach	 * Test new son names
43*323788f4SGreg Roach	 */
44*323788f4SGreg Roach	public function testNewSonNames() {
45*323788f4SGreg Roach		$this->assertSame(
46*323788f4SGreg Roach			array('NAME' => 'Jonsson'),
47*323788f4SGreg Roach			$this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'M')
48*323788f4SGreg Roach		);
49*323788f4SGreg Roach	}
50*323788f4SGreg Roach
51*323788f4SGreg Roach	/**
52*323788f4SGreg Roach	 * Test new daughter names
53*323788f4SGreg Roach	 */
54*323788f4SGreg Roach	public function testNewDaughterNames() {
55*323788f4SGreg Roach		$this->assertSame(
56*323788f4SGreg Roach			array('NAME' => 'Jonsdottir'),
57*323788f4SGreg Roach			$this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'F')
58*323788f4SGreg Roach		);
59*323788f4SGreg Roach	}
60*323788f4SGreg Roach
61*323788f4SGreg Roach	/**
62*323788f4SGreg Roach	 * Test new child names
63*323788f4SGreg Roach	 */
64*323788f4SGreg Roach	public function testNewChildNames() {
65*323788f4SGreg Roach		$this->assertSame(
66*323788f4SGreg Roach			array(),
67*323788f4SGreg Roach			$this->surname_tradition->newChildNames('Jon Einarsson', 'Eva Stefansdottir', 'U')
68*323788f4SGreg Roach		);
69*323788f4SGreg Roach	}
70*323788f4SGreg Roach
71*323788f4SGreg Roach	/**
72*323788f4SGreg Roach	 * Test new father names
73*323788f4SGreg Roach	 */
74*323788f4SGreg Roach	public function testNewFatherNames() {
75*323788f4SGreg Roach		$this->assertSame(
76*323788f4SGreg Roach			array('NAME' => 'Einar', 'GIVN' => 'Einar'),
77*323788f4SGreg Roach			$this->surname_tradition->newParentNames('Jon Einarsson', 'M')
78*323788f4SGreg Roach		);
79*323788f4SGreg Roach	}
80*323788f4SGreg Roach
81*323788f4SGreg Roach	/**
82*323788f4SGreg Roach	 * Test new mother names
83*323788f4SGreg Roach	 */
84*323788f4SGreg Roach	public function testNewMotherNames() {
85*323788f4SGreg Roach		$this->assertSame(
86*323788f4SGreg Roach			array(),
87*323788f4SGreg Roach			$this->surname_tradition->newParentNames('Jon Einarsson', 'F')
88*323788f4SGreg Roach		);
89*323788f4SGreg Roach	}
90*323788f4SGreg Roach
91*323788f4SGreg Roach	/**
92*323788f4SGreg Roach	 * Test new parent names
93*323788f4SGreg Roach	 */
94*323788f4SGreg Roach	public function testNewParentNames() {
95*323788f4SGreg Roach		$this->assertSame(
96*323788f4SGreg Roach			array(),
97*323788f4SGreg Roach			$this->surname_tradition->newParentNames('Jon Einarsson', 'U')
98*323788f4SGreg Roach		);
99*323788f4SGreg Roach	}
100*323788f4SGreg Roach
101*323788f4SGreg Roach	/**
102*323788f4SGreg Roach	 * Test new husband names
103*323788f4SGreg Roach	 */
104*323788f4SGreg Roach	public function testNewHusbandNames() {
105*323788f4SGreg Roach		$this->assertSame(
106*323788f4SGreg Roach			array(),
107*323788f4SGreg Roach			$this->surname_tradition->newSpouseNames('Eva Stefansdottir', 'M')
108*323788f4SGreg Roach		);
109*323788f4SGreg Roach	}
110*323788f4SGreg Roach
111*323788f4SGreg Roach	/**
112*323788f4SGreg Roach	 * Test new wife names
113*323788f4SGreg Roach	 */
114*323788f4SGreg Roach	public function testNewWifeNames() {
115*323788f4SGreg Roach		$this->assertSame(
116*323788f4SGreg Roach			array(),
117*323788f4SGreg Roach			$this->surname_tradition->newSpouseNames('Jon Einarsson', 'F')
118*323788f4SGreg Roach		);
119*323788f4SGreg Roach	}
120*323788f4SGreg Roach
121*323788f4SGreg Roach	/**
122*323788f4SGreg Roach	 * Test new spouse names
123*323788f4SGreg Roach	 */
124*323788f4SGreg Roach	public function testNewSpouseNames() {
125*323788f4SGreg Roach		$this->assertSame(
126*323788f4SGreg Roach			array(),
127*323788f4SGreg Roach			$this->surname_tradition->newSpouseNames('Jon Einarsson', 'U')
128*323788f4SGreg Roach		);
129*323788f4SGreg Roach	}
130*323788f4SGreg Roach}
131