xref: /webtrees/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php (revision 13abd6f3a37322f885d85df150e105d27ad81f8d)
1323788f4SGreg Roach<?php
2323788f4SGreg Roach
3323788f4SGreg Roach/**
4323788f4SGreg Roach * webtrees: online genealogy
5369c0ce6SGreg Roach * Copyright (C) 2016 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 */
17323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition;
18323788f4SGreg Roachuse Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface;
19323788f4SGreg Roach
20323788f4SGreg Roach/**
21323788f4SGreg Roach * Test harness for the class SpanishSurnameTradition
22323788f4SGreg Roach */
23db7d25eeSGreg Roachclass LithuanianSurnameTraditionTest extends \PHPUnit_Framework_TestCase {
24323788f4SGreg Roach	/** @var SurnameTraditionInterface */
25323788f4SGreg Roach	private $surname_tradition;
26323788f4SGreg Roach
27323788f4SGreg Roach	/**
28323788f4SGreg Roach	 * Prepare the environment for these tests
29323788f4SGreg Roach	 */
30323788f4SGreg Roach	public function setUp() {
31323788f4SGreg Roach		$this->surname_tradition = new LithuanianSurnameTradition;
32323788f4SGreg Roach	}
33323788f4SGreg Roach
34323788f4SGreg Roach	/**
35323788f4SGreg Roach	 * Test whether married surnames are used
3617d74f3aSGreg Roach	 *
3717d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
3873d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
39323788f4SGreg Roach	 */
40323788f4SGreg Roach	public function testMarriedSurnames() {
41323788f4SGreg Roach		$this->assertSame(true, $this->surname_tradition->hasMarriedNames());
42323788f4SGreg Roach	}
43323788f4SGreg Roach
44323788f4SGreg Roach	/**
45c1ec7145SGreg Roach	 * Test whether surnames are used
4617d74f3aSGreg Roach	 *
4717d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
4873d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
49c1ec7145SGreg Roach	 */
50c1ec7145SGreg Roach	public function testSurnames() {
51c1ec7145SGreg Roach		$this->assertSame(true, $this->surname_tradition->hasSurnames());
52c1ec7145SGreg Roach	}
53c1ec7145SGreg Roach
54c1ec7145SGreg Roach	/**
55323788f4SGreg Roach	 * Test new son names
5617d74f3aSGreg Roach	 *
5717d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
5873d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
59323788f4SGreg Roach	 */
60323788f4SGreg Roach	public function testNewSonNames() {
61323788f4SGreg Roach		$this->assertSame(
62*13abd6f3SGreg Roach			['NAME' => '/White/', 'SURN' => 'White'],
63323788f4SGreg Roach			$this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M')
64323788f4SGreg Roach		);
65323788f4SGreg Roach	}
66323788f4SGreg Roach
67323788f4SGreg Roach	/**
68323788f4SGreg Roach	 * Test new daughter names
6917d74f3aSGreg Roach	 *
7017d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
7173d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
72323788f4SGreg Roach	 */
73323788f4SGreg Roach	public function testNewDaughterNames() {
74323788f4SGreg Roach		$this->assertSame(
75*13abd6f3SGreg Roach			['NAME' => '/White/', 'SURN' => 'White'],
76323788f4SGreg Roach			$this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F')
77323788f4SGreg Roach		);
78323788f4SGreg Roach	}
79323788f4SGreg Roach
80323788f4SGreg Roach	/**
81323788f4SGreg Roach	 * Test new daughter names
8217d74f3aSGreg Roach	 *
8317d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
8473d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
85323788f4SGreg Roach	 */
86323788f4SGreg Roach	public function testNewDaughterNamesInflected() {
87323788f4SGreg Roach		$this->assertSame(
88*13abd6f3SGreg Roach			['NAME' => '/Whitaitė/', 'SURN' => 'Whita'],
89323788f4SGreg Roach			$this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F')
90323788f4SGreg Roach		);
91323788f4SGreg Roach		$this->assertSame(
92*13abd6f3SGreg Roach			['NAME' => '/Whitaitė/', 'SURN' => 'Whitas'],
93323788f4SGreg Roach			$this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F')
94323788f4SGreg Roach		);
95323788f4SGreg Roach		$this->assertSame(
96*13abd6f3SGreg Roach			['NAME' => '/Whitytė/', 'SURN' => 'Whitis'],
97323788f4SGreg Roach			$this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F')
98323788f4SGreg Roach		);
99323788f4SGreg Roach		$this->assertSame(
100*13abd6f3SGreg Roach			['NAME' => '/Whitytė/', 'SURN' => 'Whitys'],
101323788f4SGreg Roach			$this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F')
102323788f4SGreg Roach		);
103323788f4SGreg Roach		$this->assertSame(
104*13abd6f3SGreg Roach			['NAME' => '/Whitiūtė/', 'SURN' => 'Whitius'],
105323788f4SGreg Roach			$this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F')
106323788f4SGreg Roach		);
107323788f4SGreg Roach		$this->assertSame(
108*13abd6f3SGreg Roach			['NAME' => '/Whitutė/', 'SURN' => 'Whitus'],
109323788f4SGreg Roach			$this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F')
110323788f4SGreg Roach		);
111323788f4SGreg Roach	}
112323788f4SGreg Roach
113323788f4SGreg Roach	/**
114323788f4SGreg Roach	 * Test new child names
11517d74f3aSGreg Roach	 *
11617d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
11773d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
118323788f4SGreg Roach	 */
119323788f4SGreg Roach	public function testNewChildNames() {
120323788f4SGreg Roach		$this->assertSame(
121*13abd6f3SGreg Roach			['NAME' => '/White/', 'SURN' => 'White'],
122323788f4SGreg Roach			$this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U')
123323788f4SGreg Roach		);
124323788f4SGreg Roach	}
125323788f4SGreg Roach
126323788f4SGreg Roach	/**
1271677a03aSGreg Roach	 * Test new child names
12817d74f3aSGreg Roach	 *
12917d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
13073d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
1311677a03aSGreg Roach	 */
1321677a03aSGreg Roach	public function testNewChildNamesWithNoParentsNames() {
1331677a03aSGreg Roach		$this->assertSame(
134*13abd6f3SGreg Roach			['NAME' => '//'],
1351677a03aSGreg Roach			$this->surname_tradition->newChildNames('', '', 'U')
1361677a03aSGreg Roach		);
1371677a03aSGreg Roach	}
1381677a03aSGreg Roach
1391677a03aSGreg Roach	/**
140323788f4SGreg Roach	 * Test new father names
14117d74f3aSGreg Roach	 *
14217d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
14373d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
144323788f4SGreg Roach	 */
145323788f4SGreg Roach	public function testNewFatherNames() {
146323788f4SGreg Roach		$this->assertSame(
147*13abd6f3SGreg Roach			['NAME' => '/White/', 'SURN' => 'White'],
148323788f4SGreg Roach			$this->surname_tradition->newParentNames('John /White/', 'M')
149323788f4SGreg Roach		);
150323788f4SGreg Roach	}
151323788f4SGreg Roach
152323788f4SGreg Roach	/**
153323788f4SGreg Roach	 * Test new father names
15417d74f3aSGreg Roach	 *
15517d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
15673d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
157323788f4SGreg Roach	 */
158323788f4SGreg Roach	public function testNewFatherNamesInflected() {
159323788f4SGreg Roach		$this->assertSame(
160*13abd6f3SGreg Roach			['NAME' => '/Whitas/', 'SURN' => 'Whitas'],
161323788f4SGreg Roach			$this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M')
162323788f4SGreg Roach		);
163323788f4SGreg Roach		$this->assertSame(
164*13abd6f3SGreg Roach			['NAME' => '/Whitis/', 'SURN' => 'Whitis'],
165323788f4SGreg Roach			$this->surname_tradition->newParentNames('Mary /Whitytė/', 'M')
166323788f4SGreg Roach		);
167323788f4SGreg Roach		$this->assertSame(
168*13abd6f3SGreg Roach			['NAME' => '/Whitius/', 'SURN' => 'Whitius'],
169323788f4SGreg Roach			$this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M')
170323788f4SGreg Roach		);
171323788f4SGreg Roach		$this->assertSame(
172*13abd6f3SGreg Roach			['NAME' => '/Whitus/', 'SURN' => 'Whitus'],
173323788f4SGreg Roach			$this->surname_tradition->newParentNames('Mary /Whitutė/', 'M')
174323788f4SGreg Roach		);
175323788f4SGreg Roach	}
176323788f4SGreg Roach
177323788f4SGreg Roach	/**
178323788f4SGreg Roach	 * Test new mother names
17917d74f3aSGreg Roach	 *
18017d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
18173d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
182323788f4SGreg Roach	 */
183323788f4SGreg Roach	public function testNewMotherNames() {
184323788f4SGreg Roach		$this->assertSame(
185*13abd6f3SGreg Roach			['NAME' => '//'],
186323788f4SGreg Roach			$this->surname_tradition->newParentNames('John /White/', 'F')
187323788f4SGreg Roach		);
188323788f4SGreg Roach	}
189323788f4SGreg Roach
190323788f4SGreg Roach	/**
191323788f4SGreg Roach	 * Test new parent names
19217d74f3aSGreg Roach	 *
19317d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
19473d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
195323788f4SGreg Roach	 */
196323788f4SGreg Roach	public function testNewParentNames() {
197323788f4SGreg Roach		$this->assertSame(
198*13abd6f3SGreg Roach			['NAME' => '//'],
199323788f4SGreg Roach			$this->surname_tradition->newParentNames('John /White/', 'U')
200323788f4SGreg Roach		);
201323788f4SGreg Roach	}
202323788f4SGreg Roach
203323788f4SGreg Roach	/**
204323788f4SGreg Roach	 * Test new husband names
20517d74f3aSGreg Roach	 *
20617d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
20773d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
208323788f4SGreg Roach	 */
209323788f4SGreg Roach	public function testNewHusbandNames() {
210323788f4SGreg Roach		$this->assertSame(
211*13abd6f3SGreg Roach			['NAME' => '//'],
212323788f4SGreg Roach			$this->surname_tradition->newSpouseNames('Mary /Black/', 'M')
213323788f4SGreg Roach		);
214323788f4SGreg Roach	}
215323788f4SGreg Roach
216323788f4SGreg Roach	/**
217323788f4SGreg Roach	 * Test new wife names
21817d74f3aSGreg Roach	 *
21917d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
22073d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
221323788f4SGreg Roach	 */
222323788f4SGreg Roach	public function testNewWifeNames() {
223323788f4SGreg Roach		$this->assertSame(
224*13abd6f3SGreg Roach			['NAME' => '//', '_MARNM' => '/White/'],
225323788f4SGreg Roach			$this->surname_tradition->newSpouseNames('John /White/', 'F')
226323788f4SGreg Roach		);
227323788f4SGreg Roach	}
228323788f4SGreg Roach
229323788f4SGreg Roach	/**
230323788f4SGreg Roach	 * Test new spouse names
23117d74f3aSGreg Roach	 *
23217d74f3aSGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
23373d4df56SGreg Roach	 * @covers Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
234323788f4SGreg Roach	 */
235323788f4SGreg Roach	public function testNewSpouseNames() {
236323788f4SGreg Roach		$this->assertSame(
237*13abd6f3SGreg Roach			['NAME' => '//'],
238323788f4SGreg Roach			$this->surname_tradition->newSpouseNames('Chris /Green/', 'U')
239323788f4SGreg Roach		);
240323788f4SGreg Roach	}
241323788f4SGreg Roach}
242