. */ use Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition; use Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface; /** * Test harness for the class SpanishSurnameTradition */ class LithuanianSurnameTraditionTest extends PHPUnit_Framework_TestCase { /** @var SurnameTraditionInterface */ private $surname_tradition; /** * Prepare the environment for these tests */ public function setUp() { $this->surname_tradition = new LithuanianSurnameTradition; } /** * Test whether married surnames are used */ public function testMarriedSurnames() { $this->assertSame(true, $this->surname_tradition->hasMarriedNames()); } /** * Test new son names */ public function testNewSonNames() { $this->assertSame( array('NAME' => '/White/', 'SURN' => 'White'), $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'M') ); } /** * Test new daughter names */ public function testNewDaughterNames() { $this->assertSame( array('NAME' => '/White/', 'SURN' => 'White'), $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'F') ); } /** * Test new daughter names */ public function testNewDaughterNamesInflected() { $this->assertSame( array('NAME' => '/Whitaitė/', 'SURN' => 'Whita'), $this->surname_tradition->newChildNames('John /Whita/', 'Mary /Black/', 'F') ); $this->assertSame( array('NAME' => '/Whitaitė/', 'SURN' => 'Whitas'), $this->surname_tradition->newChildNames('John /Whitas/', 'Mary /Black/', 'F') ); $this->assertSame( array('NAME' => '/Whitytė/', 'SURN' => 'Whitis'), $this->surname_tradition->newChildNames('John /Whitis/', 'Mary /Black/', 'F') ); $this->assertSame( array('NAME' => '/Whitytė/', 'SURN' => 'Whitys'), $this->surname_tradition->newChildNames('John /Whitys/', 'Mary /Black/', 'F') ); $this->assertSame( array('NAME' => '/Whitiūtė/', 'SURN' => 'Whitius'), $this->surname_tradition->newChildNames('John /Whitius/', 'Mary /Black/', 'F') ); $this->assertSame( array('NAME' => '/Whitutė/', 'SURN' => 'Whitus'), $this->surname_tradition->newChildNames('John /Whitus/', 'Mary /Black/', 'F') ); } /** * Test new child names */ public function testNewChildNames() { $this->assertSame( array('NAME' => '/White/', 'SURN' => 'White'), $this->surname_tradition->newChildNames('John /White/', 'Mary /Black/', 'U') ); } /** * Test new father names */ public function testNewFatherNames() { $this->assertSame( array('NAME' => '/White/', 'SURN' => 'White'), $this->surname_tradition->newParentNames('John /White/', 'M') ); } /** * Test new father names */ public function testNewFatherNamesInflected() { $this->assertSame( array('NAME' => '/Whitas/', 'SURN' => 'Whitas'), $this->surname_tradition->newParentNames('Mary /Whitaitė/', 'M') ); $this->assertSame( array('NAME' => '/Whitis/', 'SURN' => 'Whitis'), $this->surname_tradition->newParentNames('Mary /Whitytė/', 'M') ); $this->assertSame( array('NAME' => '/Whitius/', 'SURN' => 'Whitius'), $this->surname_tradition->newParentNames('Mary /Whitiūtė/', 'M') ); $this->assertSame( array('NAME' => '/Whitus/', 'SURN' => 'Whitus'), $this->surname_tradition->newParentNames('Mary /Whitutė/', 'M') ); } /** * Test new mother names */ public function testNewMotherNames() { $this->assertSame( array('NAME' => '//'), $this->surname_tradition->newParentNames('John /White/', 'F') ); } /** * Test new parent names */ public function testNewParentNames() { $this->assertSame( array('NAME' => '//'), $this->surname_tradition->newParentNames('John /White/', 'U') ); } /** * Test new husband names */ public function testNewHusbandNames() { $this->assertSame( array('NAME' => '//'), $this->surname_tradition->newSpouseNames('Mary /Black/', 'M') ); } /** * Test new wife names */ public function testNewWifeNames() { $this->assertSame( array('NAME' => '//', '_MARNM' => '/White/'), $this->surname_tradition->newSpouseNames('John /White/', 'F') ); } /** * Test new spouse names */ public function testNewSpouseNames() { $this->assertSame( array('NAME' => '//'), $this->surname_tradition->newSpouseNames('Chris /Green/', 'U') ); } }