xref: /webtrees/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php (revision 8fcb05643f64c30848f24303db5a23cb143d848e)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2017 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 */
17use Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition;
18use Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface;
19
20/**
21 * Test harness for the class SpanishSurnameTradition
22 */
23class LithuanianSurnameTraditionTest extends \PHPUnit\Framework\TestCase {
24	/** @var SurnameTraditionInterface */
25	private $surname_tradition;
26
27	/**
28	 * Prepare the environment for these tests
29	 */
30	public function setUp() {
31		$this->surname_tradition = new LithuanianSurnameTradition;
32	}
33
34	/**
35	 * Test whether married surnames are used
36	 *
37	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
38	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
39	 */
40	public function testMarriedSurnames() {
41		$this->assertSame(true, $this->surname_tradition->hasMarriedNames());
42	}
43
44	/**
45	 * Test whether surnames are used
46	 *
47	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
48	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
49	 */
50	public function testSurnames() {
51		$this->assertSame(true, $this->surname_tradition->hasSurnames());
52	}
53
54	/**
55	 * Test new son names
56	 *
57	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
58	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
59	 */
60	public function testNewSonNames() {
61		$this->assertSame(
62			['NAME' => '/White/', 'SURN' => 'White'],
63			$this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M')
64		);
65	}
66
67	/**
68	 * Test new daughter names
69	 *
70	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
71	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
72	 */
73	public function testNewDaughterNames() {
74		$this->assertSame(
75			['NAME' => '/White/', 'SURN' => 'White'],
76			$this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F')
77		);
78	}
79
80	/**
81	 * Test new daughter names
82	 *
83	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
84	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
85	 */
86	public function testNewDaughterNamesInflected() {
87		$this->assertSame(
88			['NAME' => '/Whitaitė/', 'SURN' => 'Whita'],
89			$this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F')
90		);
91		$this->assertSame(
92			['NAME' => '/Whitaitė/', 'SURN' => 'Whitas'],
93			$this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F')
94		);
95		$this->assertSame(
96			['NAME' => '/Whitytė/', 'SURN' => 'Whitis'],
97			$this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F')
98		);
99		$this->assertSame(
100			['NAME' => '/Whitytė/', 'SURN' => 'Whitys'],
101			$this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F')
102		);
103		$this->assertSame(
104			['NAME' => '/Whitiūtė/', 'SURN' => 'Whitius'],
105			$this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F')
106		);
107		$this->assertSame(
108			['NAME' => '/Whitutė/', 'SURN' => 'Whitus'],
109			$this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F')
110		);
111	}
112
113	/**
114	 * Test new child names
115	 *
116	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
117	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
118	 */
119	public function testNewChildNames() {
120		$this->assertSame(
121			['NAME' => '/White/', 'SURN' => 'White'],
122			$this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U')
123		);
124	}
125
126	/**
127	 * Test new child names
128	 *
129	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
130	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
131	 */
132	public function testNewChildNamesWithNoParentsNames() {
133		$this->assertSame(
134			['NAME' => '//'],
135			$this->surname_tradition->newChildNames('', '', 'U')
136		);
137	}
138
139	/**
140	 * Test new father names
141	 *
142	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
143	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
144	 */
145	public function testNewFatherNames() {
146		$this->assertSame(
147			['NAME' => '/White/', 'SURN' => 'White'],
148			$this->surname_tradition->newParentNames('John /White/', 'M')
149		);
150	}
151
152	/**
153	 * Test new father names
154	 *
155	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
156	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
157	 */
158	public function testNewFatherNamesInflected() {
159		$this->assertSame(
160			['NAME' => '/Whitas/', 'SURN' => 'Whitas'],
161			$this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M')
162		);
163		$this->assertSame(
164			['NAME' => '/Whitis/', 'SURN' => 'Whitis'],
165			$this->surname_tradition->newParentNames('Mary /Whitytė/', 'M')
166		);
167		$this->assertSame(
168			['NAME' => '/Whitius/', 'SURN' => 'Whitius'],
169			$this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M')
170		);
171		$this->assertSame(
172			['NAME' => '/Whitus/', 'SURN' => 'Whitus'],
173			$this->surname_tradition->newParentNames('Mary /Whitutė/', 'M')
174		);
175	}
176
177	/**
178	 * Test new mother names
179	 *
180	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
181	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
182	 */
183	public function testNewMotherNames() {
184		$this->assertSame(
185			['NAME' => '//'],
186			$this->surname_tradition->newParentNames('John /White/', 'F')
187		);
188	}
189
190	/**
191	 * Test new parent names
192	 *
193	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
194	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
195	 */
196	public function testNewParentNames() {
197		$this->assertSame(
198			['NAME' => '//'],
199			$this->surname_tradition->newParentNames('John /White/', 'U')
200		);
201	}
202
203	/**
204	 * Test new husband names
205	 *
206	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
207	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
208	 */
209	public function testNewHusbandNames() {
210		$this->assertSame(
211			['NAME' => '//'],
212			$this->surname_tradition->newSpouseNames('Mary /Black/', 'M')
213		);
214	}
215
216	/**
217	 * Test new wife names
218	 *
219	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
220	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
221	 */
222	public function testNewWifeNames() {
223		$this->assertSame(
224			['NAME' => '//', '_MARNM' => '/White/'],
225			$this->surname_tradition->newSpouseNames('John /White/', 'F')
226		);
227	}
228
229	/**
230	 * Test new spouse names
231	 *
232	 * @covers \Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition
233	 * @covers \Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition
234	 */
235	public function testNewSpouseNames() {
236		$this->assertSame(
237			['NAME' => '//'],
238			$this->surname_tradition->newSpouseNames('Chris /Green/', 'U')
239		);
240	}
241}
242