16fcafd02SGreg Roach<?php 26fcafd02SGreg Roach 36fcafd02SGreg Roach/** 46fcafd02SGreg Roach * webtrees: online genealogy 56fcafd02SGreg Roach * Copyright (C) 2021 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; 24*d8a5ab6eSJonathan Jaubartuse Fisharebest\Webtrees\Module\LanguageEnglishGreatBritain; 25*d8a5ab6eSJonathan Jaubartuse Fisharebest\Webtrees\Module\LanguageFrench; 266fcafd02SGreg Roachuse Fisharebest\Webtrees\Services\RelationshipService; 276fcafd02SGreg Roach 286fcafd02SGreg Roach/** 296fcafd02SGreg Roach * Test the user functions 306fcafd02SGreg Roach * 316fcafd02SGreg Roach * @covers \Fisharebest\Webtrees\Relationship 326fcafd02SGreg Roach * @covers \Fisharebest\Webtrees\Services\RelationshipService 336fcafd02SGreg Roach * @covers \Fisharebest\Webtrees\Module\LanguageEnglishGreatBritain 34*d8a5ab6eSJonathan Jaubart * @covers \Fisharebest\Webtrees\Module\LanguageEnglishUnitedStates 35*d8a5ab6eSJonathan Jaubart * @covers \Fisharebest\Webtrees\Module\LanguageFrench 36b72623feSGreg Roach * @covers \Fisharebest\Webtrees\Module\ModuleLanguageTrait 376fcafd02SGreg Roach */ 386fcafd02SGreg Roachclass RelationshipNamesTest extends TestCase 396fcafd02SGreg Roach{ 406fcafd02SGreg Roach /** 416fcafd02SGreg Roach * @return void 426fcafd02SGreg Roach */ 436fcafd02SGreg Roach public function testRelationshipNames(): void 446fcafd02SGreg Roach { 456fcafd02SGreg Roach // i22m===f10===i23f 466fcafd02SGreg Roach // | 476fcafd02SGreg Roach // +-----+-----+ 486fcafd02SGreg Roach // | | 49*d8a5ab6eSJonathan Jaubart // i20m===f9===i21f i24m===f11m===i25f 50*d8a5ab6eSJonathan Jaubart // | | 51*d8a5ab6eSJonathan Jaubart // i19f===f8===i18m i26f===f12===i27m 526fcafd02SGreg Roach // | | 536fcafd02SGreg Roach // +---+---+ +---+---+ 54*d8a5ab6eSJonathan Jaubart // | | | | 55*d8a5ab6eSJonathan Jaubart // i16m===f7===i17f i30m i28u i29m===f15 56*d8a5ab6eSJonathan Jaubart // | | 57*d8a5ab6eSJonathan Jaubart // i12f===f4m===i11m i13m===f5m===i14f i34f 58*d8a5ab6eSJonathan Jaubart // | | 59*d8a5ab6eSJonathan Jaubart // i1m===f1m==========i2f===f2d===i6m=====f13m===i31m===f14d===i32f 60*d8a5ab6eSJonathan Jaubart // | | | 61*d8a5ab6eSJonathan Jaubart // +---+---+ +---+---+ | 62*d8a5ab6eSJonathan Jaubart // | | | | | | | 63*d8a5ab6eSJonathan Jaubart // i10f===f3e===i3m i4f i5u i7ma i8f i9u===f6===i15u i33f 646fcafd02SGreg Roach // 656fcafd02SGreg Roach // Individual suffixes - m(ale), f(emale), u(nknown), a(dopted) 666fcafd02SGreg Roach // Family suffixes - m(arried), d(ivorced), e(ngaged) 676fcafd02SGreg Roach // 686fcafd02SGreg Roach $tree = $this->createMock(Tree::class); 696fcafd02SGreg Roach 706fcafd02SGreg Roach $individual_factory = $this->createStub(IndividualFactory::class); 716fcafd02SGreg Roach $family_factory = $this->createStub(FamilyFactory::class); 726fcafd02SGreg Roach 736fcafd02SGreg Roach Registry::familyFactory($family_factory); 746fcafd02SGreg Roach Registry::individualFactory($individual_factory); 756fcafd02SGreg Roach 766fcafd02SGreg Roach $i1m = new Individual('i1m', "0 @i1m@ INDI\n1 SEX M\n1 FAMS @f1m@\n1 FAMC @f4m@", null, $tree); 776fcafd02SGreg Roach $i2f = new Individual('i2f', "0 @i2f@ INDI\n1 SEX F\n1 FAMS @f1m@\n1 FAMS @f2d@\n2 FAMC @f5m@", null, $tree); 786fcafd02SGreg Roach $i3m = new Individual('i3m', "0 @i3m@ INDI\n1 SEX M\n1 FAMC @f1m@\n1 FAMS @f3e@\n1 BIRT\n2 DATE 2000", null, $tree); 796fcafd02SGreg Roach $i4f = new Individual('i4f', "0 @i4f@ INDI\n1 SEX F\n1 FAMC @f1m@\n1 BIRT\n2 DATE 2001", null, $tree); 806fcafd02SGreg Roach $i5u = new Individual('i5u', "0 @i5u@ INDI\n1 SEX U\n1 FAMC @f1m@\n1 BIRT\n2 DATE 2002", null, $tree); 816fcafd02SGreg Roach $i6m = new Individual('i6m', "0 @i6m@ INDI\n1 SEX M\n1 FAMS @f2d@", null, $tree); 826fcafd02SGreg Roach $i7ma = new Individual('i7ma', "0 @i7ma@ INDI\n1 SEX M\n1 FAMC @f2d@\n2 PEDI adopted", null, $tree); 836fcafd02SGreg Roach $i8f = new Individual('i8f', "0 @i8f@ INDI\n1 SEX F\n1 FAMC @f2d@", null, $tree); 846fcafd02SGreg Roach $i9u = new Individual('i9u', "0 @i9u@ INDI\n1 SEX U\n1 FAMC @f2d@\n1 FAMS @f6@", null, $tree); 856fcafd02SGreg Roach $i10f = new Individual('i10f', "0 @i10f@ INDI\n1 SEX F\n1 FAMS @f3e@", null, $tree); 866fcafd02SGreg Roach $i11m = new Individual('i11m', "0 @i11f@ INDI\n1 SEX M\n1 FAMS @f4m@\n1 FAMC @f7@", null, $tree); 876fcafd02SGreg Roach $i12f = new Individual('i12f', "0 @i12f@ INDI\n1 SEX F\n1 FAMS @f4m@", null, $tree); 886fcafd02SGreg Roach $i13m = new Individual('i13m', "0 @i13f@ INDI\n1 SEX M\n1 FAMS @f5m@", null, $tree); 896fcafd02SGreg Roach $i14f = new Individual('i14f', "0 @i14f@ INDI\n1 SEX F\n1 FAMS @f5m@", null, $tree); 906fcafd02SGreg Roach $i15u = new Individual('i15u', "0 @i15u@ INDI\n1 SEX U\n1 FAMS @f6@", null, $tree); 916fcafd02SGreg Roach $i16m = new Individual('i16m', "0 @i16m@ INDI\n1 SEX M\n1 FAMS @f7@", null, $tree); 926fcafd02SGreg Roach $i17f = new Individual('i17f', "0 @i17f@ INDI\n1 SEX F\n1 FAMS @f7@\n1 FAMC @f8@", null, $tree); 936fcafd02SGreg Roach $i18m = new Individual('i18m', "0 @i18m@ INDI\n1 SEX M\n1 FAMS @f8@\n1 FAMC @f9@", null, $tree); 946fcafd02SGreg Roach $i19f = new Individual('i19f', "0 @i19f@ INDI\n1 SEX F\n1 FAMS @f8@", null, $tree); 956fcafd02SGreg Roach $i20m = new Individual('i20m', "0 @i20m@ INDI\n1 SEX M\n1 FAMS @f9@", null, $tree); 966fcafd02SGreg Roach $i21f = new Individual('i21f', "0 @i21f@ INDI\n1 SEX F\n1 FAMS @f9@\n1 FAMC @f10@", null, $tree); 976fcafd02SGreg Roach $i22m = new Individual('i22m', "0 @i22m@ INDI\n1 SEX M\n1 FAMS @f10@", null, $tree); 986fcafd02SGreg Roach $i23f = new Individual('i23f', "0 @i23f@ INDI\n1 SEX F\n1 FAMS @f10@", null, $tree); 99*d8a5ab6eSJonathan Jaubart $i24m = new Individual('i24m', "0 @i24m@ INDI\n1 SEX M\n1 FAMS @f11@\n1 FAMC @f10@", null, $tree); 100*d8a5ab6eSJonathan Jaubart $i25f = new Individual('i25f', "0 @i25f@ INDI\n1 SEX F\n1 FAMS @f11@", null, $tree); 101*d8a5ab6eSJonathan Jaubart $i26f = new Individual('i26f', "0 @i26f@ INDI\n1 SEX F\n1 FAMS @f12@\n1 FAMC @f11@", null, $tree); 102*d8a5ab6eSJonathan Jaubart $i27m = new Individual('i27m', "0 @i27m@ INDI\n1 SEX M\n1 FAMS @f12@", null, $tree); 103*d8a5ab6eSJonathan Jaubart $i28u = new Individual('i28u', "0 @i28u@ INDI\n1 SEX U\n1 FAMC @f12@", null, $tree); 104*d8a5ab6eSJonathan Jaubart $i29m = new Individual('i29m', "0 @i29m@ INDI\n1 SEX M\n1 FAMC @f12@", null, $tree); 105*d8a5ab6eSJonathan Jaubart $i30m = new Individual('i30m', "0 @i30m@ INDI\n1 SEX M\n1 FAMC @f8@", null, $tree); 106*d8a5ab6eSJonathan Jaubart $i31m = new Individual('i31m', "0 @i31m@ INDI\n1 SEX M\n1 FAMS @f13m@\n1 FAMS @f14d@", null, $tree); 107*d8a5ab6eSJonathan Jaubart $i32f = new Individual('i32f', "0 @i32f@ INDI\n1 SEX F\n1 FAMS @f14d@", null, $tree); 108*d8a5ab6eSJonathan Jaubart $i33f = new Individual('i33f', "0 @i33f@ INDI\n1 SEX F\n1 FAMC @f14d@", null, $tree); 109*d8a5ab6eSJonathan Jaubart $i34f = new Individual('i34f', "0 @i34f@ INDI\n1 SEX F\n1 FAMC @f15@", null, $tree); 1106fcafd02SGreg Roach 1116fcafd02SGreg Roach $individual_factory->method('make')->will($this->returnValueMap([ 1126fcafd02SGreg Roach 'i1m' => $i1m, 1136fcafd02SGreg Roach 'i2f' => $i2f, 1146fcafd02SGreg Roach 'i3m' => $i3m, 1156fcafd02SGreg Roach 'i4f' => $i4f, 1166fcafd02SGreg Roach 'i5u' => $i5u, 1176fcafd02SGreg Roach 'i6m' => $i6m, 1186fcafd02SGreg Roach 'i7ma' => $i7ma, 1196fcafd02SGreg Roach 'i8f' => $i8f, 1206fcafd02SGreg Roach 'i9u' => $i9u, 1216fcafd02SGreg Roach 'i10f' => $i10f, 1226fcafd02SGreg Roach 'i11m' => $i11m, 1236fcafd02SGreg Roach 'i12f' => $i12f, 1246fcafd02SGreg Roach 'i13m' => $i13m, 1256fcafd02SGreg Roach 'i14f' => $i14f, 1266fcafd02SGreg Roach 'i15u' => $i15u, 1276fcafd02SGreg Roach 'i16m' => $i16m, 1286fcafd02SGreg Roach 'i17f' => $i17f, 1296fcafd02SGreg Roach 'i18m' => $i18m, 1306fcafd02SGreg Roach 'i19f' => $i19f, 1316fcafd02SGreg Roach 'i20m' => $i20m, 1326fcafd02SGreg Roach 'i21f' => $i21f, 133*d8a5ab6eSJonathan Jaubart 'i22m' => $i22m, 134*d8a5ab6eSJonathan Jaubart 'i23f' => $i23f, 135*d8a5ab6eSJonathan Jaubart 'i24m' => $i24m, 136*d8a5ab6eSJonathan Jaubart 'i25f' => $i25f, 137*d8a5ab6eSJonathan Jaubart 'i26f' => $i26f, 138*d8a5ab6eSJonathan Jaubart 'i27m' => $i27m, 139*d8a5ab6eSJonathan Jaubart 'i28u' => $i28u, 140*d8a5ab6eSJonathan Jaubart 'i29m' => $i29m, 141*d8a5ab6eSJonathan Jaubart 'i30m' => $i30m, 142*d8a5ab6eSJonathan Jaubart 'i31m' => $i31m, 143*d8a5ab6eSJonathan Jaubart 'i32f' => $i32f, 144*d8a5ab6eSJonathan Jaubart 'i33f' => $i33f, 145*d8a5ab6eSJonathan Jaubart 'i34f' => $i34f 1466fcafd02SGreg Roach ])); 1476fcafd02SGreg Roach 1486fcafd02SGreg 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); 1496fcafd02SGreg 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); 1506fcafd02SGreg Roach $f3e = new Family('f3e', "0 @f3e@ FAM\n1 ENGA Y\n1 HUSB @i3m@\n1 WIFE @i10f@", null, $tree); 1516fcafd02SGreg Roach $f4m = new Family('f4m', "0 @f4m@ FAM\n1 MARR Y\n1 HUSB @i11m@\n1 WIFE @i12f@\n1 CHIL @i1m@", null, $tree); 1526fcafd02SGreg Roach $f5m = new Family('f5m', "0 @f5m@ FAM\n1 MARR Y\n1 HUSB @i13m@\n1 WIFE @i14f@\n1 CHIL @i2f@", null, $tree); 1536fcafd02SGreg Roach $f6 = new Family('f6', "0 @f6@ FAM\n1 HUSB @i9u@\n1 WIFE @i15u@", null, $tree); 1546fcafd02SGreg Roach $f7 = new Family('f7', "0 @f7@ FAM\n1 HUSB @i16m@\n1 WIFE @i17f@\n1 CHIL @i11m@", null, $tree); 155*d8a5ab6eSJonathan Jaubart $f8 = new Family('f8', "0 @f8@ FAM\n1 HUSB @i18m@\n1 WIFE @i19f@\n1 CHIL @i17f@\n1 CHIL @i30m@", null, $tree); 1566fcafd02SGreg Roach $f9 = new Family('f9', "0 @f9@ FAM\n1 HUSB @i20m@\n1 WIFE @i21f@\n1 CHIL @i18m@", null, $tree); 157*d8a5ab6eSJonathan Jaubart $f10 = new Family('f10', "0 @f10@ FAM\n1 HUSB @i22m@\n1 WIFE @i23f@\n1 CHIL @i21f@\n1 CHIL @i24m@", null, $tree); 158*d8a5ab6eSJonathan Jaubart $f11m = new Family('f11m', "0 @f11m@ FAM\n1 MARR Y\n1 HUSB @i24m@\n1 WIFE @i25f@\n1 CHIL @i26f@", null, $tree); 159*d8a5ab6eSJonathan Jaubart $f12 = new Family('f12', "0 @f12@ FAM\n1 HUSB @i27m@\n1 WIFE @i26f@\n1 CHIL @i28u@\n1 CHIL @i29m@", null, $tree); 160*d8a5ab6eSJonathan Jaubart $f13m = new Family('f13m', "0 @f13m@ FAM\n1 MARR Y\n1 HUSB @i6m@\n1 WIFE @i31m@", null, $tree); 161*d8a5ab6eSJonathan Jaubart $f14d = new Family('f14d', "0 @f14d@ FAM\n1 DIV Y\n1 HUSB @i31m@\n1 WIFE @i32f@\n1 CHIL @i33f@\n", null, $tree); 162*d8a5ab6eSJonathan Jaubart $f15 = new Family('f15', "0 @f15@ FAM\n1 HUSB @i29m@\n1 CHIL @i34f@\n", null, $tree); 1636fcafd02SGreg Roach 1646fcafd02SGreg Roach $family_factory->method('make')->will($this->returnValueMap([ 1656fcafd02SGreg Roach 'f1m' => $f1m, 1666fcafd02SGreg Roach 'f2d' => $f2d, 1676fcafd02SGreg Roach 'f3e' => $f3e, 1686fcafd02SGreg Roach 'f4m' => $f4m, 1696fcafd02SGreg Roach 'f5m' => $f5m, 1706fcafd02SGreg Roach 'f6' => $f6, 1716fcafd02SGreg Roach 'f7' => $f7, 1726fcafd02SGreg Roach 'f8' => $f8, 1736fcafd02SGreg Roach 'f9' => $f9, 1746fcafd02SGreg Roach 'f10' => $f10, 175*d8a5ab6eSJonathan Jaubart 'f11m' => $f11m, 176*d8a5ab6eSJonathan Jaubart 'f12' => $f12, 177*d8a5ab6eSJonathan Jaubart 'f13m' => $f13m, 178*d8a5ab6eSJonathan Jaubart 'f14d' => $f14d, 179*d8a5ab6eSJonathan Jaubart 'f15' => $f15 1806fcafd02SGreg Roach ])); 1816fcafd02SGreg Roach 1826fcafd02SGreg Roach $service = new RelationshipService(); 1836fcafd02SGreg Roach 1846fcafd02SGreg Roach // ENGLISH 185*d8a5ab6eSJonathan Jaubart $en_gb = new LanguageEnglishGreatBritain(); 1866fcafd02SGreg Roach // Static relationships 1876fcafd02SGreg Roach self::assertSame('wife', $service->nameFromPath([$i1m, $f1m, $i2f], $en_gb)); 1886fcafd02SGreg Roach self::assertSame('husband', $service->nameFromPath([$i2f, $f1m, $i1m], $en_gb)); 1896fcafd02SGreg Roach self::assertSame('partner', $service->nameFromPath([$i9u, $f6, $i15u], $en_gb)); 1906fcafd02SGreg Roach self::assertSame('ex-husband', $service->nameFromPath([$i2f, $f2d, $i6m], $en_gb)); 1916fcafd02SGreg Roach self::assertSame('ex-wife', $service->nameFromPath([$i6m, $f2d, $i2f], $en_gb)); 1926fcafd02SGreg Roach self::assertSame('fiancé', $service->nameFromPath([$i10f, $f3e, $i3m], $en_gb)); 1936fcafd02SGreg Roach self::assertSame('fiancée', $service->nameFromPath([$i3m, $f3e, $i10f], $en_gb)); 1946fcafd02SGreg Roach self::assertSame('son', $service->nameFromPath([$i1m, $f1m, $i3m], $en_gb)); 1956fcafd02SGreg Roach self::assertSame('daughter', $service->nameFromPath([$i1m, $f1m, $i4f], $en_gb)); 1966fcafd02SGreg Roach self::assertSame('child', $service->nameFromPath([$i1m, $f1m, $i5u], $en_gb)); 197*d8a5ab6eSJonathan Jaubart self::assertSame('elder brother', $service->nameFromPath([$i4f, $f1m, $i3m], $en_gb)); 198*d8a5ab6eSJonathan Jaubart self::assertSame('younger sister', $service->nameFromPath([$i3m, $f1m, $i4f], $en_gb)); 199*d8a5ab6eSJonathan Jaubart self::assertSame('younger sibling', $service->nameFromPath([$i3m, $f1m, $i5u], $en_gb)); 2006fcafd02SGreg Roach self::assertSame('brother', $service->nameFromPath([$i8f, $f2d, $i7ma], $en_gb)); 2016fcafd02SGreg Roach self::assertSame('sister', $service->nameFromPath([$i7ma, $f2d, $i8f], $en_gb)); 2026fcafd02SGreg Roach self::assertSame('sibling', $service->nameFromPath([$i7ma, $f2d, $i9u], $en_gb)); 2036fcafd02SGreg Roach self::assertSame('adoptive-mother', $service->nameFromPath([$i7ma, $f2d, $i2f], $en_gb)); 2046fcafd02SGreg Roach self::assertSame('adoptive-father', $service->nameFromPath([$i7ma, $f2d, $i6m], $en_gb)); 2056fcafd02SGreg Roach self::assertSame('adopted-son', $service->nameFromPath([$i6m, $f2d, $i7ma], $en_gb)); 206*d8a5ab6eSJonathan Jaubart self::assertSame('stepfather', $service->nameFromPath([$i8f, $f2d, $i2f, $f1m, $i1m], $en_gb)); 207*d8a5ab6eSJonathan Jaubart self::assertSame('stepdaughter', $service->nameFromPath([$i1m, $f1m, $i2f, $f2d, $i8f], $en_gb)); 208*d8a5ab6eSJonathan Jaubart self::assertSame('half-brother', $service->nameFromPath([$i8f, $f2d, $i2f, $f1m, $i3m], $en_gb)); 209*d8a5ab6eSJonathan Jaubart self::assertSame('stepsister', $service->nameFromPath([$i8f, $f2d, $i6m, $f13m, $i31m, $f14d, $i33f], $en_gb)); 210*d8a5ab6eSJonathan Jaubart self::assertSame('stepfather', $service->nameFromPath([$i8f, $f2d, $i6m, $f13m, $i31m], $en_gb)); 211*d8a5ab6eSJonathan Jaubart self::assertSame('mother-in-law', $service->nameFromPath([$i2f, $f1m, $i1m, $f4m, $i12f], $en_gb)); 212*d8a5ab6eSJonathan Jaubart self::assertSame('daughter-in-law', $service->nameFromPath([$i12f, $f4m, $i1m, $f1m, $i2f], $en_gb)); 2136fcafd02SGreg Roach self::assertSame('paternal-grandfather', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m], $en_gb)); 2146fcafd02SGreg Roach self::assertSame('paternal-grandmother', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i12f], $en_gb)); 2156fcafd02SGreg Roach self::assertSame('maternal-grandfather', $service->nameFromPath([$i3m, $f1m, $i2f, $f5m, $i13m], $en_gb)); 2166fcafd02SGreg Roach self::assertSame('maternal-grandmother', $service->nameFromPath([$i3m, $f1m, $i2f, $f5m, $i14f], $en_gb)); 2176fcafd02SGreg Roach // Dynamic relationships 2186fcafd02SGreg Roach self::assertSame('paternal great-grandfather', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i16m], $en_gb)); 2196fcafd02SGreg Roach self::assertSame('paternal great-grandmother', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f], $en_gb)); 2206fcafd02SGreg Roach self::assertSame('paternal great-great-grandfather', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m], $en_gb)); 2216fcafd02SGreg Roach self::assertSame('paternal great-great-grandmother', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i19f], $en_gb)); 2226fcafd02SGreg Roach self::assertSame('paternal great-great-great-grandfather', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i20m], $en_gb)); 2236fcafd02SGreg Roach self::assertSame('paternal great-great-great-grandmother', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f], $en_gb)); 2246fcafd02SGreg Roach self::assertSame('paternal great ×4 grandfather', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i22m], $en_gb)); 2256fcafd02SGreg Roach self::assertSame('paternal great ×4 grandmother', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i23f], $en_gb)); 226*d8a5ab6eSJonathan Jaubart self::assertSame('uncle', $service->nameFromPath([$i18m, $f9, $i21f, $f10, $i24m], $en_gb)); 227*d8a5ab6eSJonathan Jaubart self::assertSame('great-uncle', $service->nameFromPath([$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m], $en_gb)); 228*d8a5ab6eSJonathan Jaubart self::assertSame('great-great-uncle', $service->nameFromPath([$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m], $en_gb)); 229*d8a5ab6eSJonathan Jaubart self::assertSame('nephew', $service->nameFromPath([$i24m, $f10, $i21f, $f9, $i18m], $en_gb)); 230*d8a5ab6eSJonathan Jaubart self::assertSame('great-niece', $service->nameFromPath([$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f], $en_gb)); 231*d8a5ab6eSJonathan Jaubart self::assertSame('great-great-nephew', $service->nameFromPath([$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f, $f7, $i11m], $en_gb)); 232*d8a5ab6eSJonathan Jaubart self::assertSame('first cousin', $service->nameFromPath([$i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en_gb)); 233*d8a5ab6eSJonathan Jaubart self::assertSame('second cousin', $service->nameFromPath([$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $en_gb)); 234*d8a5ab6eSJonathan Jaubart self::assertSame('first cousin once removed ascending', $service->nameFromPath([$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $en_gb)); 235*d8a5ab6eSJonathan Jaubart self::assertSame('first cousin once removed descending', $service->nameFromPath([$i26f, $f11m, $i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f], $en_gb)); 236*d8a5ab6eSJonathan Jaubart self::assertSame('second cousin once removed ascending', $service->nameFromPath([ $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $en_gb)); 2376fcafd02SGreg Roach // Compound relationships 2386fcafd02SGreg Roach self::assertSame('wife’s ex-husband', $service->nameFromPath([$i1m, $f1m, $i2f, $f2d, $i6m], $en_gb)); 2396fcafd02SGreg Roach 240*d8a5ab6eSJonathan Jaubart // FRENCH 241*d8a5ab6eSJonathan Jaubart $fr = new LanguageFrench(); 242*d8a5ab6eSJonathan Jaubart 243*d8a5ab6eSJonathan Jaubart // Static relationships 244*d8a5ab6eSJonathan Jaubart self::assertSame('épouse', $service->nameFromPath([$i1m, $f1m, $i2f], $fr)); 245*d8a5ab6eSJonathan Jaubart self::assertSame('époux', $service->nameFromPath([$i2f, $f1m, $i1m], $fr)); 246*d8a5ab6eSJonathan Jaubart self::assertSame('conjoint', $service->nameFromPath([$i9u, $f6, $i15u], $fr)); 247*d8a5ab6eSJonathan Jaubart self::assertSame('ex-époux', $service->nameFromPath([$i2f, $f2d, $i6m], $fr)); 248*d8a5ab6eSJonathan Jaubart self::assertSame('ex-épouse', $service->nameFromPath([$i6m, $f2d, $i2f], $fr)); 249*d8a5ab6eSJonathan Jaubart self::assertSame('fiancé', $service->nameFromPath([$i10f, $f3e, $i3m], $fr)); 250*d8a5ab6eSJonathan Jaubart self::assertSame('fiancée', $service->nameFromPath([$i3m, $f3e, $i10f], $fr)); 251*d8a5ab6eSJonathan Jaubart self::assertSame('fils', $service->nameFromPath([$i1m, $f1m, $i3m], $fr)); 252*d8a5ab6eSJonathan Jaubart self::assertSame('fille', $service->nameFromPath([$i1m, $f1m, $i4f], $fr)); 253*d8a5ab6eSJonathan Jaubart self::assertSame('enfant', $service->nameFromPath([$i1m, $f1m, $i5u], $fr)); 254*d8a5ab6eSJonathan Jaubart self::assertSame('grand frère', $service->nameFromPath([$i4f, $f1m, $i3m], $fr)); 255*d8a5ab6eSJonathan Jaubart self::assertSame('petite sœur', $service->nameFromPath([$i3m, $f1m, $i4f], $fr)); 256*d8a5ab6eSJonathan Jaubart self::assertSame('petit frère/sœur', $service->nameFromPath([$i3m, $f1m, $i5u], $fr)); 257*d8a5ab6eSJonathan Jaubart self::assertSame('frère', $service->nameFromPath([$i8f, $f2d, $i7ma], $fr)); 258*d8a5ab6eSJonathan Jaubart self::assertSame('sœur', $service->nameFromPath([$i7ma, $f2d, $i8f], $fr)); 259*d8a5ab6eSJonathan Jaubart self::assertSame('frère/sœur', $service->nameFromPath([$i7ma, $f2d, $i9u], $fr)); 260*d8a5ab6eSJonathan Jaubart self::assertSame('mère adoptive', $service->nameFromPath([$i7ma, $f2d, $i2f], $fr)); 261*d8a5ab6eSJonathan Jaubart self::assertSame('père adoptif', $service->nameFromPath([$i7ma, $f2d, $i6m], $fr)); 262*d8a5ab6eSJonathan Jaubart self::assertSame('fils adoptif', $service->nameFromPath([$i6m, $f2d, $i7ma], $fr)); 263*d8a5ab6eSJonathan Jaubart self::assertSame('beau-père', $service->nameFromPath([$i8f, $f2d, $i2f, $f1m, $i1m], $fr)); 264*d8a5ab6eSJonathan Jaubart self::assertSame('belle-fille', $service->nameFromPath([$i1m, $f1m, $i2f, $f2d, $i8f], $fr)); 265*d8a5ab6eSJonathan Jaubart self::assertSame('demi-frère', $service->nameFromPath([$i8f, $f2d, $i2f, $f1m, $i3m], $fr)); 266*d8a5ab6eSJonathan Jaubart self::assertSame('quasi-sœur', $service->nameFromPath([$i8f, $f2d, $i6m, $f13m, $i31m, $f14d, $i33f], $fr)); 267*d8a5ab6eSJonathan Jaubart self::assertSame('beau-père', $service->nameFromPath([$i8f, $f2d, $i6m, $f13m, $i31m], $fr)); 268*d8a5ab6eSJonathan Jaubart self::assertSame('belle-mère', $service->nameFromPath([$i2f, $f1m, $i1m, $f4m, $i12f], $fr)); 269*d8a5ab6eSJonathan Jaubart self::assertSame('belle-fille', $service->nameFromPath([$i12f, $f4m, $i1m, $f1m, $i2f], $fr)); 270*d8a5ab6eSJonathan Jaubart // Dynamic relationships 271*d8a5ab6eSJonathan Jaubart self::assertSame('grand-père paternel', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m], $fr)); 272*d8a5ab6eSJonathan Jaubart self::assertSame('grand-mère paternelle', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i12f], $fr)); 273*d8a5ab6eSJonathan Jaubart self::assertSame('grand-père maternel', $service->nameFromPath([$i3m, $f1m, $i2f, $f5m, $i13m], $fr)); 274*d8a5ab6eSJonathan Jaubart self::assertSame('grand-mère maternelle', $service->nameFromPath([$i3m, $f1m, $i2f, $f5m, $i14f], $fr)); 275*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-grand-père paternel', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i16m], $fr)); 276*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-grand-mère paternelle', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f], $fr)); 277*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-arrière-grand-père paternel', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m], $fr)); 278*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-arrière-grand-mère paternelle', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i19f], $fr)); 279*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-(x3)-grand-père paternel', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i20m], $fr)); 280*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-(x3)-grand-mère paternelle', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f], $fr)); 281*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-(x4)-grand-père paternel', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i22m], $fr)); 282*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-(x4)-grand-mère paternelle', $service->nameFromPath([$i3m, $f1m, $i1m, $f4m, $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i23f], $fr)); 283*d8a5ab6eSJonathan Jaubart self::assertSame('oncle', $service->nameFromPath([$i18m, $f9, $i21f, $f10, $i24m], $fr)); 284*d8a5ab6eSJonathan Jaubart self::assertSame('grand-oncle', $service->nameFromPath([$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m], $fr)); 285*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-grand-oncle', $service->nameFromPath([$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m], $fr)); 286*d8a5ab6eSJonathan Jaubart self::assertSame('neveu', $service->nameFromPath([$i24m, $f10, $i21f, $f9, $i18m], $fr)); 287*d8a5ab6eSJonathan Jaubart self::assertSame('petite-nièce', $service->nameFromPath([$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f], $fr)); 288*d8a5ab6eSJonathan Jaubart self::assertSame('arrière-petit-neveu', $service->nameFromPath([$i24m, $f10, $i21f, $f9, $i18m, $f8, $i17f, $f7, $i11m], $fr)); 289*d8a5ab6eSJonathan Jaubart self::assertSame('cousine germaine', $service->nameFromPath([$i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $fr)); 290*d8a5ab6eSJonathan Jaubart self::assertSame('cousin issu de germain', $service->nameFromPath([$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $fr)); 291*d8a5ab6eSJonathan Jaubart self::assertSame('cousine au 3<sup>e</sup> degré', $service->nameFromPath([$i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $fr)); 292*d8a5ab6eSJonathan Jaubart self::assertSame('grand-cousine', $service->nameFromPath([$i30m, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f], $fr)); 293*d8a5ab6eSJonathan Jaubart self::assertSame('petit-cousin', $service->nameFromPath([$i26f, $f11m, $i24m, $f10, $i21f, $f9, $i18m, $f8, $i30m], $fr)); 294*d8a5ab6eSJonathan Jaubart self::assertSame('cousin du 2<sup>e</sup> au 3<sup>e</sup> degré', $service->nameFromPath([ $i11m, $f7, $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m], $fr)); 295*d8a5ab6eSJonathan Jaubart self::assertSame('cousine du 3<sup>e</sup> au 2<sup>e</sup> degré', $service->nameFromPath([ $i17f, $f8, $i18m, $f9, $i21f, $f10, $i24m, $f11m, $i26f, $f12, $i29m, $f15, $i34f], $fr)); 296*d8a5ab6eSJonathan Jaubart // Compound relationships 297*d8a5ab6eSJonathan Jaubart self::assertSame('ex-époux de l’épouse', $service->nameFromPath([$i1m, $f1m, $i2f, $f2d, $i6m], $fr)); 298*d8a5ab6eSJonathan Jaubart 2996fcafd02SGreg Roach // SLOVAK 3006fcafd02SGreg Roach } 3016fcafd02SGreg Roach} 302