16fcafd02SGreg Roach<?php 26fcafd02SGreg Roach 36fcafd02SGreg Roach/** 46fcafd02SGreg Roach * webtrees: online genealogy 5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team 66fcafd02SGreg Roach * This program is free software: you can redistribute it and/or modify 76fcafd02SGreg Roach * it under the terms of the GNU General Public License as published by 86fcafd02SGreg Roach * the Free Software Foundation, either version 3 of the License, or 96fcafd02SGreg Roach * (at your option) any later version. 106fcafd02SGreg Roach * This program is distributed in the hope that it will be useful, 116fcafd02SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 126fcafd02SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 136fcafd02SGreg Roach * GNU General Public License for more details. 146fcafd02SGreg Roach * You should have received a copy of the GNU General Public License 156fcafd02SGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>. 166fcafd02SGreg Roach */ 176fcafd02SGreg Roach 186fcafd02SGreg Roachdeclare(strict_types=1); 196fcafd02SGreg Roach 206fcafd02SGreg Roachnamespace Fisharebest\Webtrees; 216fcafd02SGreg Roach 226fcafd02SGreg Roachuse Fisharebest\Webtrees\Factories\FamilyFactory; 236fcafd02SGreg Roachuse Fisharebest\Webtrees\Factories\IndividualFactory; 24a004d330SGreg Roachuse Fisharebest\Webtrees\Module\LanguageEnglishAustralia; 25d8a5ab6eSJonathan Jaubartuse Fisharebest\Webtrees\Module\LanguageEnglishGreatBritain; 26a004d330SGreg Roachuse Fisharebest\Webtrees\Module\LanguageEnglishUnitedStates; 27d8a5ab6eSJonathan Jaubartuse Fisharebest\Webtrees\Module\LanguageFrench; 282c927a63SGreg Roachuse Fisharebest\Webtrees\Module\LanguageSlovakian; 29a004d330SGreg Roachuse Fisharebest\Webtrees\Module\ModuleLanguageInterface; 30202c018bSGreg Roachuse Fisharebest\Webtrees\Module\ModuleLanguageTrait; 316fcafd02SGreg Roachuse Fisharebest\Webtrees\Services\RelationshipService; 32202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass; 33202c018bSGreg Roach 34a004d330SGreg Roachuse function array_reverse; 35a004d330SGreg Roach 36202c018bSGreg Roach#[CoversClass(Relationship::class)] 37202c018bSGreg Roach#[CoversClass(RelationshipService::class)] 38202c018bSGreg Roach#[CoversClass(LanguageEnglishGreatBritain::class)] 39202c018bSGreg Roach#[CoversClass(LanguageEnglishUnitedStates::class)] 40202c018bSGreg Roach#[CoversClass(LanguageFrench::class)] 41*168400f2SJulien BARBEY#[CoversTrait(ModuleLanguageTrait::class)] 426fcafd02SGreg Roachclass RelationshipNamesTest extends TestCase 436fcafd02SGreg Roach{ 447573bc3dSGreg Roach protected static bool $uses_database = true; 457573bc3dSGreg Roach 466fcafd02SGreg Roach public function testRelationshipNames(): void 476fcafd02SGreg Roach { 486fcafd02SGreg Roach // i22m===f10===i23f 496fcafd02SGreg Roach // | 506fcafd02SGreg Roach // +-----+-----+ 516fcafd02SGreg Roach // | | 52d8a5ab6eSJonathan Jaubart // i20m===f9===i21f i24m===f11m===i25f 53d8a5ab6eSJonathan Jaubart // | | 54d8a5ab6eSJonathan Jaubart // i19f===f8===i18m i26f===f12===i27m 556fcafd02SGreg Roach // | | 56c2a86322SGreg Roach // +---+---+-----+ +---+---+ 57c2a86322SGreg Roach // | | | | | 58c2a86322SGreg Roach // i16m===f7===i17f i30m i37f i28u i29m===f15 59d8a5ab6eSJonathan Jaubart // | | 60c2a86322SGreg Roach // +-----------------+ | 61c2a86322SGreg Roach // | | | 62c2a86322SGreg Roach // i38f i12f===f4m===i11m i13m===f5m===i14f i34f===f16 63d8a5ab6eSJonathan Jaubart // | | | 6441e0cd5cSGreg Roach // i1m===f1m==========i2f===f2d===i6m=====f13m===i31m===f14d===i32f i35m===f17 6541e0cd5cSGreg Roach // | | | | 663d9e70a5SJonathan Jaubart // +---+---+ +---+---+ +-----+ | 673d9e70a5SJonathan Jaubart // | | | | | | | | | 683d9e70a5SJonathan Jaubart // i10f===f3e===i3m i4f i5u i7ma i8f i9u===f6===i15u i33f i39mo i36f 696fcafd02SGreg Roach // 703d9e70a5SJonathan Jaubart // Individual suffixes - m(ale), f(emale), u(nknown), a(dopted), o(foster) 716fcafd02SGreg Roach // Family suffixes - m(arried), d(ivorced), e(ngaged) 726fcafd02SGreg Roach // 736fcafd02SGreg Roach $tree = $this->createMock(Tree::class); 746fcafd02SGreg Roach 7562ff2f18SGreg Roach $individual_factory = $this->createMock(IndividualFactory::class); 7662ff2f18SGreg Roach $family_factory = $this->createMock(FamilyFactory::class); 776fcafd02SGreg Roach 786fcafd02SGreg Roach Registry::familyFactory($family_factory); 796fcafd02SGreg Roach Registry::individualFactory($individual_factory); 806fcafd02SGreg Roach 816fcafd02SGreg Roach $i1m = new Individual('i1m', "0 @i1m@ INDI\n1 SEX M\n1 FAMS @f1m@\n1 FAMC @f4m@", null, $tree); 826fcafd02SGreg Roach $i2f = new Individual('i2f', "0 @i2f@ INDI\n1 SEX F\n1 FAMS @f1m@\n1 FAMS @f2d@\n2 FAMC @f5m@", null, $tree); 836fcafd02SGreg Roach $i3m = new Individual('i3m', "0 @i3m@ INDI\n1 SEX M\n1 FAMC @f1m@\n1 FAMS @f3e@\n1 BIRT\n2 DATE 2000", null, $tree); 846fcafd02SGreg Roach $i4f = new Individual('i4f', "0 @i4f@ INDI\n1 SEX F\n1 FAMC @f1m@\n1 BIRT\n2 DATE 2001", null, $tree); 856fcafd02SGreg Roach $i5u = new Individual('i5u', "0 @i5u@ INDI\n1 SEX U\n1 FAMC @f1m@\n1 BIRT\n2 DATE 2002", null, $tree); 866fcafd02SGreg Roach $i6m = new Individual('i6m', "0 @i6m@ INDI\n1 SEX M\n1 FAMS @f2d@", null, $tree); 876fcafd02SGreg Roach $i7ma = new Individual('i7ma', "0 @i7ma@ INDI\n1 SEX M\n1 FAMC @f2d@\n2 PEDI adopted", null, $tree); 886fcafd02SGreg Roach $i8f = new Individual('i8f', "0 @i8f@ INDI\n1 SEX F\n1 FAMC @f2d@", null, $tree); 896fcafd02SGreg Roach $i9u = new Individual('i9u', "0 @i9u@ INDI\n1 SEX U\n1 FAMC @f2d@\n1 FAMS @f6@", null, $tree); 906fcafd02SGreg Roach $i10f = new Individual('i10f', "0 @i10f@ INDI\n1 SEX F\n1 FAMS @f3e@", null, $tree); 916fcafd02SGreg Roach $i11m = new Individual('i11m', "0 @i11f@ INDI\n1 SEX M\n1 FAMS @f4m@\n1 FAMC @f7@", null, $tree); 926fcafd02SGreg Roach $i12f = new Individual('i12f', "0 @i12f@ INDI\n1 SEX F\n1 FAMS @f4m@", null, $tree); 936fcafd02SGreg Roach $i13m = new Individual('i13m', "0 @i13f@ INDI\n1 SEX M\n1 FAMS @f5m@", null, $tree); 946fcafd02SGreg Roach $i14f = new Individual('i14f', "0 @i14f@ INDI\n1 SEX F\n1 FAMS @f5m@", null, $tree); 956fcafd02SGreg Roach $i15u = new Individual('i15u', "0 @i15u@ INDI\n1 SEX U\n1 FAMS @f6@", null, $tree); 966fcafd02SGreg Roach $i16m = new Individual('i16m', "0 @i16m@ INDI\n1 SEX M\n1 FAMS @f7@", null, $tree); 976fcafd02SGreg Roach $i17f = new Individual('i17f', "0 @i17f@ INDI\n1 SEX F\n1 FAMS @f7@\n1 FAMC @f8@", null, $tree); 986fcafd02SGreg Roach $i18m = new Individual('i18m', "0 @i18m@ INDI\n1 SEX M\n1 FAMS @f8@\n1 FAMC @f9@", null, $tree); 996fcafd02SGreg Roach $i19f = new Individual('i19f', "0 @i19f@ INDI\n1 SEX F\n1 FAMS @f8@", null, $tree); 1006fcafd02SGreg Roach $i20m = new Individual('i20m', "0 @i20m@ INDI\n1 SEX M\n1 FAMS @f9@", null, $tree); 1016fcafd02SGreg Roach $i21f = new Individual('i21f', "0 @i21f@ INDI\n1 SEX F\n1 FAMS @f9@\n1 FAMC @f10@", null, $tree); 1026fcafd02SGreg Roach $i22m = new Individual('i22m', "0 @i22m@ INDI\n1 SEX M\n1 FAMS @f10@", null, $tree); 1036fcafd02SGreg Roach $i23f = new Individual('i23f', "0 @i23f@ INDI\n1 SEX F\n1 FAMS @f10@", null, $tree); 104d8a5ab6eSJonathan Jaubart $i24m = new Individual('i24m', "0 @i24m@ INDI\n1 SEX M\n1 FAMS @f11@\n1 FAMC @f10@", null, $tree); 105d8a5ab6eSJonathan Jaubart $i25f = new Individual('i25f', "0 @i25f@ INDI\n1 SEX F\n1 FAMS @f11@", null, $tree); 106d8a5ab6eSJonathan Jaubart $i26f = new Individual('i26f', "0 @i26f@ INDI\n1 SEX F\n1 FAMS @f12@\n1 FAMC @f11@", null, $tree); 107d8a5ab6eSJonathan Jaubart $i27m = new Individual('i27m', "0 @i27m@ INDI\n1 SEX M\n1 FAMS @f12@", null, $tree); 108d8a5ab6eSJonathan Jaubart $i28u = new Individual('i28u', "0 @i28u@ INDI\n1 SEX U\n1 FAMC @f12@", null, $tree); 109d8a5ab6eSJonathan Jaubart $i29m = new Individual('i29m', "0 @i29m@ INDI\n1 SEX M\n1 FAMC @f12@", null, $tree); 110d8a5ab6eSJonathan Jaubart $i30m = new Individual('i30m', "0 @i30m@ INDI\n1 SEX M\n1 FAMC @f8@", null, $tree); 111d8a5ab6eSJonathan Jaubart $i31m = new Individual('i31m', "0 @i31m@ INDI\n1 SEX M\n1 FAMS @f13m@\n1 FAMS @f14d@", null, $tree); 112d8a5ab6eSJonathan Jaubart $i32f = new Individual('i32f', "0 @i32f@ INDI\n1 SEX F\n1 FAMS @f14d@", null, $tree); 113d8a5ab6eSJonathan Jaubart $i33f = new Individual('i33f', "0 @i33f@ INDI\n1 SEX F\n1 FAMC @f14d@", null, $tree); 114d8a5ab6eSJonathan Jaubart $i34f = new Individual('i34f', "0 @i34f@ INDI\n1 SEX F\n1 FAMC @f15@", null, $tree); 11541e0cd5cSGreg Roach $i35m = new Individual('i35m', "0 @i35m@ INDI\n1 SEX M\n1 FAMS @f17@\n1 FAMC @f16@", null, $tree); 116c2a86322SGreg Roach $i36f = new Individual('i36f', "0 @i36f@ INDI\n1 SEX F\n1 FAMC @f17@", null, $tree); 117c2a86322SGreg Roach $i37f = new Individual('i37f', "0 @i37f@ INDI\n1 SEX F\n1 FAMC @f8@", null, $tree); 118c2a86322SGreg Roach $i38f = new Individual('i38f', "0 @i38f@ INDI\n1 SEX F\n1 FAMC @f7@", null, $tree); 1193d9e70a5SJonathan Jaubart $i39mo = new Individual('i39mo', "0 @i39o@ INDI\n1 SEX M\n1 FAMC @f14d@\n2 PEDI foster", null, $tree); 1206fcafd02SGreg Roach 121246e8de0SGreg Roach $individual_factory->method('make')->willReturnMap([ 1226c026d70SGreg Roach ['i1m', $i1m], 1236c026d70SGreg Roach ['i2f', $i2f], 1246c026d70SGreg Roach ['i3m', $i3m], 1256c026d70SGreg Roach ['i4f', $i4f], 1266c026d70SGreg Roach ['i5u', $i5u], 1276c026d70SGreg Roach ['i6m', $i6m], 1286c026d70SGreg Roach ['i7ma', $i7ma], 1296c026d70SGreg Roach ['i8f', $i8f], 1306c026d70SGreg Roach ['i9u', $i9u], 1316c026d70SGreg Roach ['i10f', $i10f], 1326c026d70SGreg Roach ['i11m', $i11m], 1336c026d70SGreg Roach ['i12f', $i12f], 1346c026d70SGreg Roach ['i13m', $i13m], 1356c026d70SGreg Roach ['i14f', $i14f], 1366c026d70SGreg Roach ['i15u', $i15u], 1376c026d70SGreg Roach ['i16m', $i16m], 1386c026d70SGreg Roach ['i17f', $i17f], 1396c026d70SGreg Roach ['i18m', $i18m], 1406c026d70SGreg Roach ['i19f', $i19f], 1416c026d70SGreg Roach ['i20m', $i20m], 1426c026d70SGreg Roach ['i21f', $i21f], 1436c026d70SGreg Roach ['i22m', $i22m], 1446c026d70SGreg Roach ['i23f', $i23f], 1456c026d70SGreg Roach ['i24m', $i24m], 1466c026d70SGreg Roach ['i25f', $i25f], 1476c026d70SGreg Roach ['i26f', $i26f], 1486c026d70SGreg Roach ['i27m', $i27m], 1496c026d70SGreg Roach ['i28u', $i28u], 1506c026d70SGreg Roach ['i29m', $i29m], 1516c026d70SGreg Roach ['i30m', $i30m], 1526c026d70SGreg Roach ['i31m', $i31m], 1536c026d70SGreg Roach ['i32f', $i32f], 1546c026d70SGreg Roach ['i33f', $i33f], 1556c026d70SGreg Roach ['i34f', $i34f], 1566c026d70SGreg Roach ['i35m', $i35m], 1576c026d70SGreg Roach ['i36f', $i36f], 1586c026d70SGreg Roach ['i37f', $i37f], 1596c026d70SGreg Roach ['i38f', $i38f], 1606c026d70SGreg Roach ['i39mo', $i39mo], 161246e8de0SGreg Roach ]); 1626fcafd02SGreg Roach 1636fcafd02SGreg Roach $f1m = new Family('f1m', "0 @f1m@ FAM\n1 MARR Y\n1 HUSB @i1m@\n1 WIFE @i2f@\n1 CHIL @i3m@\n1 CHIL @i4f@\n1 CHIL @i5u@", null, $tree); 1646fcafd02SGreg Roach $f2d = new Family('f2d', "0 @f2d@ FAM\n1 DIV Y\n1 HUSB @i6m@\n1 WIFE @i2f@\n1 CHIL @i7ma@\n1 CHIL @i8f@\n1 CHIL @i9u@", null, $tree); 1656fcafd02SGreg Roach $f3e = new Family('f3e', "0 @f3e@ FAM\n1 ENGA Y\n1 HUSB @i3m@\n1 WIFE @i10f@", null, $tree); 1666fcafd02SGreg Roach $f4m = new Family('f4m', "0 @f4m@ FAM\n1 MARR Y\n1 HUSB @i11m@\n1 WIFE @i12f@\n1 CHIL @i1m@", null, $tree); 1676fcafd02SGreg Roach $f5m = new Family('f5m', "0 @f5m@ FAM\n1 MARR Y\n1 HUSB @i13m@\n1 WIFE @i14f@\n1 CHIL @i2f@", null, $tree); 1686fcafd02SGreg Roach $f6 = new Family('f6', "0 @f6@ FAM\n1 HUSB @i9u@\n1 WIFE @i15u@", null, $tree); 169c2a86322SGreg Roach $f7 = new Family('f7', "0 @f7@ FAM\n1 HUSB @i16m@\n1 WIFE @i17f@\n1 CHIL @i11m@\n1 CHIL @i38f@", null, $tree); 170c2a86322SGreg Roach $f8 = new Family('f8', "0 @f8@ FAM\n1 HUSB @i18m@\n1 WIFE @i19f@\n1 CHIL @i17f@\n1 CHIL @i30m@\n1 CHIL @i37f@", null, $tree); 1716fcafd02SGreg Roach $f9 = new Family('f9', "0 @f9@ FAM\n1 HUSB @i20m@\n1 WIFE @i21f@\n1 CHIL @i18m@", null, $tree); 172d8a5ab6eSJonathan Jaubart $f10 = new Family('f10', "0 @f10@ FAM\n1 HUSB @i22m@\n1 WIFE @i23f@\n1 CHIL @i21f@\n1 CHIL @i24m@", null, $tree); 173d8a5ab6eSJonathan Jaubart $f11m = new Family('f11m', "0 @f11m@ FAM\n1 MARR Y\n1 HUSB @i24m@\n1 WIFE @i25f@\n1 CHIL @i26f@", null, $tree); 174d8a5ab6eSJonathan Jaubart $f12 = new Family('f12', "0 @f12@ FAM\n1 HUSB @i27m@\n1 WIFE @i26f@\n1 CHIL @i28u@\n1 CHIL @i29m@", null, $tree); 175d8a5ab6eSJonathan Jaubart $f13m = new Family('f13m', "0 @f13m@ FAM\n1 MARR Y\n1 HUSB @i6m@\n1 WIFE @i31m@", null, $tree); 1763d9e70a5SJonathan Jaubart $f14d = new Family('f14d', "0 @f14d@ FAM\n1 DIV Y\n1 HUSB @i31m@\n1 WIFE @i32f@\n1 CHIL @i33f@\n1 CHIL @i39mo@", null, $tree); 1773d9e70a5SJonathan Jaubart $f15 = new Family('f15', "0 @f15@ FAM\n1 HUSB @i29m@\n1 CHIL @i34f@", null, $tree); 1783d9e70a5SJonathan Jaubart $f16 = new Family('f16', "0 @f16@ FAM\n1 WIFE @i34f@\n1 CHIL @i35m@", null, $tree); 1793d9e70a5SJonathan Jaubart $f17 = new Family('f17', "0 @f17@ FAM\n1 HUSB @i35m@\n1 CHIL @i36f@", null, $tree); 1806fcafd02SGreg Roach 181246e8de0SGreg Roach $family_factory->method('make')->willReturnMap([ 1826c026d70SGreg Roach ['f1m', $f1m], 1836c026d70SGreg Roach ['f2d', $f2d], 1846c026d70SGreg Roach ['f3e', $f3e], 1856c026d70SGreg Roach ['f4m', $f4m], 1866c026d70SGreg Roach ['f5m', $f5m], 1876c026d70SGreg Roach ['f6', $f6], 1886c026d70SGreg Roach ['f7', $f7], 1896c026d70SGreg Roach ['f8', $f8], 1906c026d70SGreg Roach ['f9', $f9], 1916c026d70SGreg Roach ['f10', $f10], 1926c026d70SGreg Roach ['f11m', $f11m], 1936c026d70SGreg Roach ['f12', $f12], 1946c026d70SGreg Roach ['f13m', $f13m], 1956c026d70SGreg Roach ['f14d', $f14d], 1966c026d70SGreg Roach ['f15', $f15], 1976c026d70SGreg Roach ['f16', $f16], 1986c026d70SGreg Roach ['f17', $f17], 199246e8de0SGreg Roach ]); 2006fcafd02SGreg Roach 201a004d330SGreg Roach /////////////////////////////////////////////////////////////////////// 2026fcafd02SGreg Roach // ENGLISH 203a004d330SGreg Roach /////////////////////////////////////////////////////////////////////// 204a004d330SGreg Roach 205a004d330SGreg Roach $en_au = new LanguageEnglishAustralia(); 206d8a5ab6eSJonathan Jaubart $en_gb = new LanguageEnglishGreatBritain(); 207a004d330SGreg Roach $en_us = new LanguageEnglishUnitedStates(); 2086fcafd02SGreg Roach 209a004d330SGreg Roach foreach ([$en_us, $en_gb, $en_au] as $en) { 210a004d330SGreg Roach self::assertRelationships('wife', 'husband', [$i1m, $f1m, $i2f], $en); 211a004d330SGreg Roach self::assertRelationships('partner', 'partner', [$i9u, $f6, $i15u], $en); 212a004d330SGreg Roach self::assertRelationships('ex-husband', 'ex-wife', [$i2f, $f2d, $i6m], $en); 213a004d330SGreg Roach self::assertRelationships('fiancé', 'fiancée', [$i10f, $f3e, $i3m], $en); 214a004d330SGreg Roach self::assertRelationships('son', 'father', [$i1m, $f1m, $i3m], $en); 215a004d330SGreg Roach self::assertRelationships('daughter', 'mother', [$i2f, $f1m, $i4f], $en); 216a004d330SGreg Roach self::assertRelationships('child', 'father', [$i1m, $f1m, $i5u], $en); 217a004d330SGreg Roach self::assertRelationships('elder brother', 'younger sister', [$i4f, $f1m, $i3m], $en); 218a004d330SGreg Roach self::assertRelationships('younger sibling', 'elder brother', [$i3m, $f1m, $i5u], $en); 219a004d330SGreg Roach self::assertRelationships('brother', 'sister', [$i8f, $f2d, $i7ma], $en); 220a004d330SGreg Roach self::assertRelationships('sibling', 'brother', [$i7ma, $f2d, $i9u], $en); 221a004d330SGreg Roach self::assertRelationships('adoptive-mother', 'adopted-son', [$i7ma, $f2d, $i2f], $en); 222a004d330SGreg Roach self::assertRelationships('stepfather', 'stepchild', [$i9u, $f2d, $i2f, $f1m, $i1m], $en); 223a004d330SGreg Roach self::assertRelationships('stepdaughter', 'stepmother', [$i2f, $f1m, $i2f, $f2d, $i8f], $en); 224a004d330SGreg Roach self::assertRelationships('stepsister', 'stepsibling', [$i9u, $f2d, $i6m, $f13m, $i31m, $f14d, $i33f], $en); 225a004d330SGreg Roach self::assertRelationships('half-brother', 'half-sister', [$i8f, $f2d, $i2f, $f1m, $i3m], $en); 226a004d330SGreg Roach self::assertRelationships('mother-in-law', 'daughter-in-law', [$i2f, $f1m, $i1m, $f4m, $i12f], $en); 227a004d330SGreg Roach self::assertRelationships('paternal-grandfather', 'grandson', [$i3m, $f1m, $i1m, $f4m, $i11m], $en); 228a004d330SGreg Roach self::assertRelationships('paternal-grandmother', 'granddaughter', [$i4f, $f1m, $i1m, $f4m, $i12f], $en); 229a004d330SGreg Roach self::assertRelationships('maternal-grandfather', 'grandson', [$i3m, $f1m, $i2f, $f5m, $i13m], $en); 230a004d330SGreg Roach self::assertRelationships('maternal-grandmother', 'grandchild', [$i5u, $f1m, $i2f, $f5m, $i14f], $en); 231c2a86322SGreg Roach self::assertRelationships('paternal great-grandfather', 'great-grandson', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i16m], $en); 232c2a86322SGreg Roach self::assertRelationships('paternal great-grandmother', 'great-granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f], $en); 233c2a86322SGreg Roach self::assertRelationships('paternal great-great-grandfather', 'great-great-grandson', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m], $en); 234c2a86322SGreg Roach self::assertRelationships('paternal great-great-grandmother', 'great-great-granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i19f], $en); 235c2a86322SGreg Roach self::assertRelationships('paternal great-great-great-grandfather', 'great-great-great-grandson', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i20m], $en); 236c2a86322SGreg Roach self::assertRelationships('paternal great-great-great-grandmother', 'great-great-great-granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f], $en); 237c2a86322SGreg Roach self::assertRelationships('paternal great ×4 grandfather', 'great ×4 grandson', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i22m], $en); 238c2a86322SGreg Roach self::assertRelationships('paternal great ×4 grandmother', 'great ×4 granddaughter', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i23f], $en); 239c2a86322SGreg Roach self::assertRelationships('aunt', 'niece', [$i38f, $f7, $i17f, $f8, $i37f], $en); 240c2a86322SGreg Roach self::assertRelationships('great-uncle', 'great-nephew', [$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m], $en); 241c2a86322SGreg Roach self::assertRelationships('great-great-uncle', 'great-great-nephew', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m], $en); 242c2a86322SGreg Roach self::assertRelationships('nephew', 'uncle', [$i24m, $f10, $i21f, $f9, $i18m], $en); 243c2a86322SGreg Roach self::assertRelationships('great-niece', 'great-uncle', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f], $en); 244c2a86322SGreg Roach self::assertRelationships('great-great-nephew', 'great-great-uncle', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f, $f7, $i11m], $en); 24541e0cd5cSGreg Roach self::assertRelationships('first cousin', 'first cousin', [$i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en); 24641e0cd5cSGreg Roach self::assertRelationships('second cousin', 'second cousin', [$i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $en); 24741e0cd5cSGreg Roach self::assertRelationships('first cousin once removed ascending', 'first cousin once removed descending', [$i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en); 24841e0cd5cSGreg Roach self::assertRelationships('third cousin', 'third cousin', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $en); 24941e0cd5cSGreg Roach self::assertRelationships('second cousin once removed ascending', 'second cousin once removed descending', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $en); 25041e0cd5cSGreg Roach self::assertRelationships('first cousin twice removed ascending', 'first cousin twice removed descending', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en); 25141e0cd5cSGreg Roach self::assertRelationships('fourth cousin', 'fourth cousin', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f, $f16, $i35m], $en); 25241e0cd5cSGreg Roach self::assertRelationships('third cousin once removed ascending', 'third cousin once removed descending', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $en); 25341e0cd5cSGreg Roach self::assertRelationships('second cousin twice removed ascending', 'second cousin twice removed descending', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $en); 254a004d330SGreg Roach // Compound relationships 255c2a86322SGreg Roach self::assertRelationships('wife’s ex-husband', 'ex-wife’s husband', [$i1m, $f1m, $i2f, $f2d, $i6m], $en); 256a004d330SGreg Roach } 257a004d330SGreg Roach 258f1de4d34SGreg Roach // This relationship has a different name in different variants of English. 25941e0cd5cSGreg Roach self::assertRelationships('first cousin thrice removed ascending', 'first cousin thrice removed descending', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en_au); 26041e0cd5cSGreg Roach self::assertRelationships('first cousin thrice removed ascending', 'first cousin thrice removed descending', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en_gb); 26141e0cd5cSGreg Roach self::assertRelationships('first cousin three times removed ascending', 'first cousin three times removed descending', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en_us); 26241e0cd5cSGreg Roach 263a004d330SGreg Roach /////////////////////////////////////////////////////////////////////// 264d8a5ab6eSJonathan Jaubart // FRENCH 265a004d330SGreg Roach /////////////////////////////////////////////////////////////////////// 266d8a5ab6eSJonathan Jaubart 267a004d330SGreg Roach $fr_fr = new LanguageFrench(); 268a004d330SGreg Roach $fr_ca = new LanguageFrench(); 269a004d330SGreg Roach 270a004d330SGreg Roach foreach ([$fr_fr, $fr_ca] as $fr) { 271f1de4d34SGreg Roach self::assertRelationships('épouse', 'époux', [$i1m, $f1m, $i2f], $fr); 272f1de4d34SGreg Roach self::assertRelationships('conjoint', 'conjoint', [$i9u, $f6, $i15u], $fr); 273f1de4d34SGreg Roach self::assertRelationships('ex-époux', 'ex-épouse', [$i2f, $f2d, $i6m], $fr); 274f1de4d34SGreg Roach self::assertRelationships('fiancé', 'fiancée', [$i10f, $f3e, $i3m], $fr); 275f1de4d34SGreg Roach self::assertRelationships('fils', 'père', [$i1m, $f1m, $i3m], $fr); 276f1de4d34SGreg Roach self::assertRelationships('fille', 'mère', [$i2f, $f1m, $i4f], $fr); 277f1de4d34SGreg Roach self::assertRelationships('enfant', 'père', [$i1m, $f1m, $i5u], $fr); 278f1de4d34SGreg Roach self::assertRelationships('grand frère', 'petite sœur', [$i4f, $f1m, $i3m], $fr); 279f1de4d34SGreg Roach self::assertRelationships('petit frère/sœur', 'grand frère', [$i3m, $f1m, $i5u], $fr); 2803d9e70a5SJonathan Jaubart self::assertRelationships('frère', 'sœur', [$i38f, $f7, $i11m], $fr); 2813d9e70a5SJonathan Jaubart self::assertRelationships('frère/sœur', 'sœur', [$i8f, $f2d, $i9u], $fr); 2823d9e70a5SJonathan Jaubart self::assertRelationships('mère adoptive', 'fils adoptif', [$i7ma, $f2d, $i2f], $fr); 2833d9e70a5SJonathan Jaubart self::assertRelationships('père adoptif', 'fils adoptif', [$i7ma, $f2d, $i6m], $fr); 2843d9e70a5SJonathan Jaubart self::assertRelationships('sœur adoptive', 'frère adoptif', [$i7ma, $f2d, $i8f], $fr); 2853d9e70a5SJonathan Jaubart self::assertRelationships('mère d’accueil', 'fils accueilli', [$i39mo, $f14d, $i32f], $fr); 2863d9e70a5SJonathan Jaubart self::assertRelationships('père d’accueil', 'fils accueilli', [$i39mo, $f14d, $i31m], $fr); 2873d9e70a5SJonathan Jaubart self::assertRelationships('sœur d’accueil', 'frère accueilli', [$i39mo, $f14d, $i33f], $fr); 2883d9e70a5SJonathan Jaubart self::assertRelationships('beau-père', 'belle-fille', [$i8f, $f2d, $i2f, $f1m, $i1m], $fr); 2893d9e70a5SJonathan Jaubart self::assertRelationships('demi-frère', 'demi-frère/sœur', [$i9u, $f2d, $i2f, $f1m, $i3m], $fr); 290a004d330SGreg Roach self::assertRelationship('quasi-sœur', [$i8f, $f2d, $i6m, $f13m, $i31m, $f14d, $i33f], $fr); 2913d9e70a5SJonathan Jaubart self::assertRelationships('beau-père', 'gendre', [$i1m, $f1m, $i2f, $f5m, $i13m], $fr); 2923d9e70a5SJonathan Jaubart self::assertRelationships('belle-mère', 'bru', [$i2f, $f1m, $i1m, $f4m, $i12f], $fr); 293f1de4d34SGreg Roach self::assertRelationships('grand-père paternel', 'petit-fils', [$i3m, $f1m, $i1m, $f4m, $i11m], $fr); 294f1de4d34SGreg Roach self::assertRelationships('grand-mère paternelle', 'petite-fille', [$i4f, $f1m, $i1m, $f4m, $i12f], $fr); 295f1de4d34SGreg Roach self::assertRelationships('grand-père maternel', 'petit-fils', [$i3m, $f1m, $i2f, $f5m, $i13m], $fr); 296f1de4d34SGreg Roach self::assertRelationships('grand-mère maternelle', 'petite-fille', [$i4f, $f1m, $i2f, $f5m, $i14f], $fr); 297f1de4d34SGreg Roach self::assertRelationships('arrière-grand-père paternel', 'arrière-petit-fils', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i16m], $fr); 298f1de4d34SGreg Roach self::assertRelationships('arrière-grand-mère paternelle', 'arrière-petite-fille', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f], $fr); 2993d9e70a5SJonathan Jaubart self::assertRelationships('trisaïeul paternel', 'petit-fils au 3<sup>e</sup> degré', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m], $fr); 3003d9e70a5SJonathan Jaubart self::assertRelationships('trisaïeule paternelle', 'petite-fille au 3<sup>e</sup> degré', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i19f], $fr); 3013d9e70a5SJonathan Jaubart self::assertRelationships('grand-père paternel au 4<sup>e</sup> degré', 'petit-fils au 4<sup>e</sup> degré', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i20m], $fr); 3023d9e70a5SJonathan Jaubart self::assertRelationships('grand-mère paternelle au 4<sup>e</sup> degré', 'petite-fille au 4<sup>e</sup> degré', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f], $fr); 303f1de4d34SGreg Roach self::assertRelationships('oncle', 'neveu', [$i18m, $f9, $i21f, $f10, $i24m], $fr); 3043d9e70a5SJonathan Jaubart self::assertRelationships('grand-oncle', 'petite-nièce', [$i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m], $fr); 305f1de4d34SGreg Roach self::assertRelationships('arrière-grand-oncle', 'arrière-petit-neveu', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m], $fr); 3063d9e70a5SJonathan Jaubart self::assertRelationships('grand-oncle au 3<sup>e</sup> degré', 'petit-neveu au 3<sup>e</sup> degré', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m], $fr); 3073d9e70a5SJonathan Jaubart self::assertRelationships('grand-oncle au 4<sup>e</sup> degré', 'petite-nièce au 4<sup>e</sup> degré', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m], $fr); 308f1de4d34SGreg Roach self::assertRelationships('cousine germaine', 'cousin germain', [$i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $fr); 309f1de4d34SGreg Roach self::assertRelationships('cousin issu de germain', 'cousin issu de germain', [$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $fr); 310f1de4d34SGreg Roach self::assertRelationships('cousine au 3<sup>e</sup> degré', 'cousin au 3<sup>e</sup> degré', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $fr); 311f1de4d34SGreg Roach self::assertRelationships('grand-cousine', 'petit-cousin', [$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $fr); 312f1de4d34SGreg Roach self::assertRelationships('petit-cousin', 'grand-cousine', [$i26f, $f11m, $i24m, $f10, $i21f, $f9, $i18m, $f8, $i30m], $fr); 313f1de4d34SGreg Roach self::assertRelationships('cousin du 2<sup>e</sup> au 3<sup>e</sup> degré', 'cousin du 3<sup>e</sup> au 2<sup>e</sup> degré', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $fr); 314f1de4d34SGreg Roach self::assertRelationships('cousine du 3<sup>e</sup> au 2<sup>e</sup> degré', 'cousine du 2<sup>e</sup> au 3<sup>e</sup> degré', [$i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $fr); 315d8a5ab6eSJonathan Jaubart // Compound relationships 316f1de4d34SGreg Roach self::assertRelationships('ex-époux de l’épouse', 'époux de l’ex-épouse', [$i1m, $f1m, $i2f, $f2d, $i6m], $fr); 3173d9e70a5SJonathan Jaubart self::assertRelationship('fiancée du petit-neveu au 4<sup>e</sup> degré', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f, $f7, $i11m, $f4m, $i1m, $f1m, $i3m, $f3e, $i10f], $fr); 3183d9e70a5SJonathan Jaubart self::assertRelationship('épouse de l’arrière-petit-neveu', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f, $f7, $i11m, $f4m, $i12f], $fr); 3193d9e70a5SJonathan Jaubart self::assertRelationship('conjoint de la petite-nièce', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f, $f7, $i16m], $fr); 3203d9e70a5SJonathan Jaubart self::assertRelationship('conjointe du neveu', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i19f], $fr); 32196c67f5bSJonathan Jaubart self::assertRelationships('cousine germaine du conjoint', 'conjointe du cousin germain', [$i19f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $fr); 322a004d330SGreg Roach } 323d8a5ab6eSJonathan Jaubart 324a004d330SGreg Roach /////////////////////////////////////////////////////////////////////// 3256fcafd02SGreg Roach // SLOVAK 326a004d330SGreg Roach /////////////////////////////////////////////////////////////////////// 327696d9d5cSGreg Roach 3282c927a63SGreg Roach $sk = new LanguageSlovakian(); 329696d9d5cSGreg Roach 3302c927a63SGreg Roach self::assertRelationships('manželka', 'manžel', [$i1m, $f1m, $i2f], $sk); 3312c927a63SGreg Roach self::assertRelationships('partner', 'partner', [$i9u, $f6, $i15u], $sk); 3322c927a63SGreg Roach self::assertRelationships('exmanžel', 'exmanželka', [$i2f, $f2d, $i6m], $sk); 3332c927a63SGreg Roach self::assertRelationships('snúbenica', 'snúbenec', [$i10f, $f3e, $i3m], $sk); 3342c927a63SGreg Roach self::assertRelationships('syn', 'otec', [$i1m, $f1m, $i3m], $sk); 3352c927a63SGreg Roach self::assertRelationships('dcéra', 'matka', [$i2f, $f1m, $i4f], $sk); 3362c927a63SGreg Roach self::assertRelationships('dieťa', 'otec', [$i1m, $f1m, $i5u], $sk); 3372c927a63SGreg Roach self::assertRelationships('brat', 'sestra', [$i4f, $f1m, $i3m], $sk); 3382c927a63SGreg Roach self::assertRelationships('súrodenec', 'brat', [$i3m, $f1m, $i5u], $sk); 3392c927a63SGreg Roach self::assertRelationships('brat', 'sestra', [$i8f, $f2d, $i7ma], $sk); 3402c927a63SGreg Roach self::assertRelationships('súrodenec', 'brat', [$i7ma, $f2d, $i9u], $sk); 3412c927a63SGreg Roach self::assertRelationships('matka', 'syn', [$i7ma, $f2d, $i2f], $sk); 3422c927a63SGreg Roach self::assertRelationships('manžel matky', 'dieťa manželky', [$i9u, $f2d, $i2f, $f1m, $i1m], $sk); 3432c927a63SGreg Roach self::assertRelationships('dcéra manželky', 'manželka matky', [$i2f, $f1m, $i2f, $f2d, $i8f], $sk); 3442c927a63SGreg Roach self::assertRelationships('dcéra manžela otca', 'dieťa manžela otca', [$i9u, $f2d, $i6m, $f13m, $i31m, $f14d, $i33f], $sk); 3452c927a63SGreg Roach self::assertRelationships('nevlastný brat', 'nevlastná sestra', [$i8f, $f2d, $i2f, $f1m, $i3m], $sk); 3462c927a63SGreg Roach self::assertRelationships('svokra', 'nevesta', [$i2f, $f1m, $i1m, $f4m, $i12f], $sk); 3472c927a63SGreg Roach self::assertRelationships('starý otec', 'vnuk', [$i3m, $f1m, $i1m, $f4m, $i11m], $sk); 3482c927a63SGreg Roach self::assertRelationships('stará matka', 'vnučka', [$i4f, $f1m, $i1m, $f4m, $i12f], $sk); 3492c927a63SGreg Roach self::assertRelationships('starý otec', 'vnuk', [$i3m, $f1m, $i2f, $f5m, $i13m], $sk); 3502c927a63SGreg Roach self::assertRelationships('stará matka', 'vnúča', [$i5u, $f1m, $i2f, $f5m, $i14f], $sk); 3512c927a63SGreg Roach self::assertRelationships('prastarý otec', 'pravnuk', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i16m], $sk); 3522c927a63SGreg Roach self::assertRelationships('prastarý otec', 'pravnučka', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f], $sk); 3532c927a63SGreg Roach self::assertRelationships('pra-pra-pra-prastarý otec', 'pravnuk dcéry', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m], $sk); 3542c927a63SGreg Roach self::assertRelationships('pra-pra-pra-prastará matka', 'pravnučka dcéry', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i19f], $sk); 3552c927a63SGreg Roach self::assertRelationships('pra ×4 prastarý otec', 'pravnuk vnučky', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i20m], $sk); 3562c927a63SGreg Roach self::assertRelationships('pra ×4 prastará matka', 'pravnučka vnučky', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f], $sk); 3572c927a63SGreg Roach self::assertRelationships('pra ×5 prastarý otec', 'pravnuk pravnučky', [$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i22m], $sk); 3582c927a63SGreg Roach self::assertRelationships('pra ×5 prastará matka', 'pravnučka pravnučky', [$i4f, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i23f], $sk); 3592c927a63SGreg Roach self::assertRelationships('teta', 'neter', [$i38f, $f7, $i17f, $f8, $i37f], $sk); 3602c927a63SGreg Roach self::assertRelationships('prastrýko', 'prasynovec', [$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m], $sk); 3612c927a63SGreg Roach self::assertRelationships('pra-prastrýko', 'pravnuk sestry', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m], $sk); 3622c927a63SGreg Roach self::assertRelationships('synovec', 'ujo', [$i24m, $f10, $i21f, $f9, $i18m], $sk); 3632c927a63SGreg Roach self::assertRelationships('praneter', 'prastrýko', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f], $sk); 3642c927a63SGreg Roach self::assertRelationships('pravnuk sestry', 'pra-prastrýko', [$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f, $f7, $i11m], $sk); 3652c927a63SGreg Roach self::assertRelationships('sesternica', 'bratranec', [$i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $sk); 3662c927a63SGreg Roach self::assertRelationships('druhostupňový bratranec', 'druhostupňová sesternica', [$i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $sk); 3672c927a63SGreg Roach self::assertRelationships('sesternica otca', 'praneter otca', [$i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $sk); 3682c927a63SGreg Roach self::assertRelationships('sesternica z 3. kolena', 'bratranec z 3. kolena', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $sk); 3692c927a63SGreg Roach self::assertRelationships('druhostupňový bratranec matky', 'syn druhostupňovej sesternice', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $sk); 3702c927a63SGreg Roach self::assertRelationships('pra-dcéra prastrýka', 'pravnuk tety', [$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $sk); 3712c927a63SGreg Roach self::assertRelationships('bratranec zo 4. kolena', 'bratranec zo 4. kolena', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f, $f16, $i35m], $sk); 3722c927a63SGreg Roach self::assertRelationships('sesternica z 3. kolena otca', 'syn bratranca z 3. kolena', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $sk); 3732c927a63SGreg Roach self::assertRelationships('druhostupňový bratranec starej matky', 'vnuk druhostupňovej sesternice', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $sk); 3742c927a63SGreg Roach self::assertRelationships('pra-pra-dcéra prastrýka', 'pravnuk bratranca', [$i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $sk); // Compound relationships 3752c927a63SGreg Roach self::assertRelationships('exmanžel manželky', 'manžel exmanželky', [$i1m, $f1m, $i2f, $f2d, $i6m], $sk); 376a004d330SGreg Roach } 377a004d330SGreg Roach 378a004d330SGreg Roach /** 37909482a55SGreg Roach * @param array<Individual|Family> $nodes 380a004d330SGreg Roach */ 381a004d330SGreg Roach private static function assertRelationship(string $expected, array $nodes, ModuleLanguageInterface $language): void 382a004d330SGreg Roach { 383a004d330SGreg Roach $service = new RelationshipService(); 384a004d330SGreg Roach $actual = $service->nameFromPath($nodes, $language); 38505babb96SGreg Roach $path = implode('-', array_map(static fn (GedcomRecord $record): string => $record->xref(), $nodes)); 386a004d330SGreg Roach $english = $service->nameFromPath($nodes, new LanguageEnglishUnitedStates()); 387a004d330SGreg Roach $message = 'Language: ' . $language->title() . PHP_EOL . 'Path: ' . $path . ' (' . $english . ')'; 388a004d330SGreg Roach 389a004d330SGreg Roach self::assertSame($expected, $actual, $message); 390a004d330SGreg Roach } 391a004d330SGreg Roach 392a004d330SGreg Roach /** 393a004d330SGreg Roach * Test a relationship name in both directions 394a004d330SGreg Roach * 39509482a55SGreg Roach * @param array<Individual|Family> $nodes 396a004d330SGreg Roach */ 397a004d330SGreg Roach private static function assertRelationships(string $fwd, string $rev, array $nodes, ModuleLanguageInterface $language): void 398a004d330SGreg Roach { 399a004d330SGreg Roach self::assertRelationship($fwd, $nodes, $language); 400a004d330SGreg Roach self::assertRelationship($rev, array_reverse($nodes), $language); 4016fcafd02SGreg Roach } 4026fcafd02SGreg Roach} 403