1db7d25eeSGreg Roach<?php 2db7d25eeSGreg Roach/** 3db7d25eeSGreg Roach * webtrees: online genealogy 41062a142SGreg Roach * Copyright (C) 2018 webtrees development team 5db7d25eeSGreg Roach * This program is free software: you can redistribute it and/or modify 6db7d25eeSGreg Roach * it under the terms of the GNU General Public License as published by 7db7d25eeSGreg Roach * the Free Software Foundation, either version 3 of the License, or 8db7d25eeSGreg Roach * (at your option) any later version. 9db7d25eeSGreg Roach * This program is distributed in the hope that it will be useful, 10db7d25eeSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 11db7d25eeSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12db7d25eeSGreg Roach * GNU General Public License for more details. 13db7d25eeSGreg Roach * You should have received a copy of the GNU General Public License 14db7d25eeSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 15db7d25eeSGreg Roach */ 16db7d25eeSGreg Roachnamespace Fisharebest\Webtrees\Census; 17db7d25eeSGreg Roach 18db7d25eeSGreg Roachuse Mockery; 19db7d25eeSGreg Roach 20db7d25eeSGreg Roach/** 21db7d25eeSGreg Roach * Test harness for the class CensusColumnBornForeignParts 22db7d25eeSGreg Roach */ 23*84e2cf4eSGreg Roachclass CensusColumnBornForeignPartsTest extends \Fisharebest\Webtrees\TestCase 24c1010edaSGreg Roach{ 25db7d25eeSGreg Roach /** 26db7d25eeSGreg Roach * Delete mock objects 27db7d25eeSGreg Roach */ 28c1010edaSGreg Roach public function tearDown() 29c1010edaSGreg Roach { 30db7d25eeSGreg Roach Mockery::close(); 31db7d25eeSGreg Roach } 32db7d25eeSGreg Roach 33db7d25eeSGreg Roach /** 3416d0b7f7SRico Sonntag * Get place mock. 3516d0b7f7SRico Sonntag * 3616d0b7f7SRico Sonntag * @param string $place Gedcom Place 3716d0b7f7SRico Sonntag * 3816d0b7f7SRico Sonntag * @return \Fisharebest\Webtrees\Place 3916d0b7f7SRico Sonntag */ 408f53f488SRico Sonntag private function getPlaceMock($place): \Fisharebest\Webtrees\Place 41c1010edaSGreg Roach { 4216d0b7f7SRico Sonntag $placeParts = explode(', ', $place); 4316d0b7f7SRico Sonntag 4416d0b7f7SRico Sonntag $placeMock = Mockery::mock('\Fisharebest\Webtrees\Place'); 4516d0b7f7SRico Sonntag $placeMock->shouldReceive('getGedcomName')->andReturn($place); 4616d0b7f7SRico Sonntag $placeMock->shouldReceive('lastPart')->andReturn(end($placeParts)); 4716d0b7f7SRico Sonntag 4816d0b7f7SRico Sonntag return $placeMock; 4916d0b7f7SRico Sonntag } 5016d0b7f7SRico Sonntag 5116d0b7f7SRico Sonntag /** 5215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 5315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 54db7d25eeSGreg Roach */ 55c1010edaSGreg Roach public function testBornEnglandCensusEngland() 56c1010edaSGreg Roach { 57c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 5816d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('London, England')); 59db7d25eeSGreg Roach 60c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 61db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('England'); 62db7d25eeSGreg Roach 63ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 64db7d25eeSGreg Roach 65342dcecdSGreg Roach $this->assertSame('', $column->generate($individual, $individual)); 66db7d25eeSGreg Roach } 67db7d25eeSGreg Roach 68db7d25eeSGreg Roach /** 6915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 7015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 71db7d25eeSGreg Roach */ 72c1010edaSGreg Roach public function testBornWalesCensusEngland() 73c1010edaSGreg Roach { 74c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 7516d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Cardiff, Wales')); 76db7d25eeSGreg Roach 77c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 78db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('England'); 79db7d25eeSGreg Roach 80ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 81db7d25eeSGreg Roach 82342dcecdSGreg Roach $this->assertSame('', $column->generate($individual, $individual)); 83db7d25eeSGreg Roach } 84db7d25eeSGreg Roach 85db7d25eeSGreg Roach /** 8615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 8715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 88db7d25eeSGreg Roach */ 89c1010edaSGreg Roach public function testBornScotlandCensusEngland() 90c1010edaSGreg Roach { 91c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 9216d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Edinburgh, Scotland')); 93db7d25eeSGreg Roach 94c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 95db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('England'); 96db7d25eeSGreg Roach 97ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 98db7d25eeSGreg Roach 99342dcecdSGreg Roach $this->assertSame('S', $column->generate($individual, $individual)); 100db7d25eeSGreg Roach } 101db7d25eeSGreg Roach 102db7d25eeSGreg Roach /** 10315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 10415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 105db7d25eeSGreg Roach */ 106c1010edaSGreg Roach public function testBornIrelandCensusEngland() 107c1010edaSGreg Roach { 108c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 10916d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Dublin, Ireland')); 110db7d25eeSGreg Roach 111c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 112db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('England'); 113db7d25eeSGreg Roach 114ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 115db7d25eeSGreg Roach 116342dcecdSGreg Roach $this->assertSame('I', $column->generate($individual, $individual)); 117db7d25eeSGreg Roach } 118db7d25eeSGreg Roach 119db7d25eeSGreg Roach /** 12015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 12115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 122db7d25eeSGreg Roach */ 123c1010edaSGreg Roach public function testBornForeignCensusEngland() 124c1010edaSGreg Roach { 125c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 12616d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Elbonia')); 127db7d25eeSGreg Roach 128c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 129db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('England'); 130db7d25eeSGreg Roach 131ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 132db7d25eeSGreg Roach 133342dcecdSGreg Roach $this->assertSame('F', $column->generate($individual, $individual)); 134db7d25eeSGreg Roach } 135db7d25eeSGreg Roach 136db7d25eeSGreg Roach /** 13715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 13815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 139db7d25eeSGreg Roach */ 140c1010edaSGreg Roach public function testBornEnglandCensusIreland() 141c1010edaSGreg Roach { 142c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 14316d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('London, England')); 144db7d25eeSGreg Roach 145c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 146db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Ireland'); 147db7d25eeSGreg Roach 148ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 149db7d25eeSGreg Roach 150342dcecdSGreg Roach $this->assertSame('E', $column->generate($individual, $individual)); 151db7d25eeSGreg Roach } 152db7d25eeSGreg Roach 153db7d25eeSGreg Roach /** 15415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 15515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 156db7d25eeSGreg Roach */ 157c1010edaSGreg Roach public function testBornWalesCensusIreland() 158c1010edaSGreg Roach { 159c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 16016d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Cardiff, Wales')); 161db7d25eeSGreg Roach 162c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 163db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Ireland'); 164db7d25eeSGreg Roach 165ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 166db7d25eeSGreg Roach 167342dcecdSGreg Roach $this->assertSame('E', $column->generate($individual, $individual)); 168db7d25eeSGreg Roach } 169db7d25eeSGreg Roach 170db7d25eeSGreg Roach /** 17115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 17215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 173db7d25eeSGreg Roach */ 174c1010edaSGreg Roach public function testBornScotlandCensusIreland() 175c1010edaSGreg Roach { 176c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 17716d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Edinburgh, Scotland')); 178db7d25eeSGreg Roach 179c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 180db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Ireland'); 181db7d25eeSGreg Roach 182ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 183db7d25eeSGreg Roach 184342dcecdSGreg Roach $this->assertSame('S', $column->generate($individual, $individual)); 185db7d25eeSGreg Roach } 186db7d25eeSGreg Roach 187db7d25eeSGreg Roach /** 18815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 18915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 190db7d25eeSGreg Roach */ 191c1010edaSGreg Roach public function testBornIrelandCensusIreland() 192c1010edaSGreg Roach { 193c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 19416d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Dublin, Ireland')); 195db7d25eeSGreg Roach 196c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 197db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Ireland'); 198db7d25eeSGreg Roach 199ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 200db7d25eeSGreg Roach 201342dcecdSGreg Roach $this->assertSame('', $column->generate($individual, $individual)); 202db7d25eeSGreg Roach } 203db7d25eeSGreg Roach 204db7d25eeSGreg Roach /** 20515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 20615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 207db7d25eeSGreg Roach */ 208c1010edaSGreg Roach public function testBornForeignCensusIreland() 209c1010edaSGreg Roach { 210c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 21116d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Elbonia')); 212db7d25eeSGreg Roach 213c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 214db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Ireland'); 215db7d25eeSGreg Roach 216ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 217db7d25eeSGreg Roach 218342dcecdSGreg Roach $this->assertSame('F', $column->generate($individual, $individual)); 219db7d25eeSGreg Roach } 220db7d25eeSGreg Roach 221db7d25eeSGreg Roach /** 22215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 22315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 224db7d25eeSGreg Roach */ 225c1010edaSGreg Roach public function testBornEnglandCensusScotland() 226c1010edaSGreg Roach { 227c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 22816d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('London, England')); 229db7d25eeSGreg Roach 230c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 231db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Scotland'); 232db7d25eeSGreg Roach 233ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 234db7d25eeSGreg Roach 235342dcecdSGreg Roach $this->assertSame('E', $column->generate($individual, $individual)); 236db7d25eeSGreg Roach } 237db7d25eeSGreg Roach 238db7d25eeSGreg Roach /** 23915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 24015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 241db7d25eeSGreg Roach */ 242c1010edaSGreg Roach public function testBornWalesCensusScotland() 243c1010edaSGreg Roach { 244c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 24516d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Cardiff, Wales')); 246db7d25eeSGreg Roach 247c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 248db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Scotland'); 249db7d25eeSGreg Roach 250ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 251db7d25eeSGreg Roach 252342dcecdSGreg Roach $this->assertSame('E', $column->generate($individual, $individual)); 253db7d25eeSGreg Roach } 254db7d25eeSGreg Roach 255db7d25eeSGreg Roach /** 25615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 25715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 258db7d25eeSGreg Roach */ 259c1010edaSGreg Roach public function testBornScotlandCensusScotland() 260c1010edaSGreg Roach { 261c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 26216d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Edinburgh, Scotland')); 263db7d25eeSGreg Roach 264c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 265db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Scotland'); 266db7d25eeSGreg Roach 267ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 268db7d25eeSGreg Roach 269342dcecdSGreg Roach $this->assertSame('', $column->generate($individual, $individual)); 270db7d25eeSGreg Roach } 271db7d25eeSGreg Roach 272db7d25eeSGreg Roach /** 27315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 27415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 275db7d25eeSGreg Roach */ 276c1010edaSGreg Roach public function testBornIrelandCensusScotland() 277c1010edaSGreg Roach { 278c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 27916d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Dublin, Ireland')); 280db7d25eeSGreg Roach 281c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 282db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Scotland'); 283db7d25eeSGreg Roach 284ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 285db7d25eeSGreg Roach 286342dcecdSGreg Roach $this->assertSame('I', $column->generate($individual, $individual)); 287db7d25eeSGreg Roach } 288db7d25eeSGreg Roach 289db7d25eeSGreg Roach /** 29015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 29115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 292db7d25eeSGreg Roach */ 293c1010edaSGreg Roach public function testBornForeignCensusScotland() 294c1010edaSGreg Roach { 295c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 29616d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Elbonia')); 297db7d25eeSGreg Roach 298c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 299db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Scotland'); 300db7d25eeSGreg Roach 301ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 302db7d25eeSGreg Roach 303342dcecdSGreg Roach $this->assertSame('F', $column->generate($individual, $individual)); 304db7d25eeSGreg Roach } 305db7d25eeSGreg Roach 306db7d25eeSGreg Roach /** 30715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 30815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 309db7d25eeSGreg Roach */ 310c1010edaSGreg Roach public function testBornEnglandCensusWales() 311c1010edaSGreg Roach { 312c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 31316d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('London, England')); 314db7d25eeSGreg Roach 315c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 316db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Wales'); 317db7d25eeSGreg Roach 318ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 319db7d25eeSGreg Roach 320342dcecdSGreg Roach $this->assertSame('', $column->generate($individual, $individual)); 321db7d25eeSGreg Roach } 322db7d25eeSGreg Roach 323db7d25eeSGreg Roach /** 32415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 32515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 326db7d25eeSGreg Roach */ 327c1010edaSGreg Roach public function testBornWalesCensusWales() 328c1010edaSGreg Roach { 329c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 33016d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Cardiff, Wales')); 331db7d25eeSGreg Roach 332c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 333db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Wales'); 334db7d25eeSGreg Roach 335ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 336db7d25eeSGreg Roach 337342dcecdSGreg Roach $this->assertSame('', $column->generate($individual, $individual)); 338db7d25eeSGreg Roach } 339db7d25eeSGreg Roach 340db7d25eeSGreg Roach /** 34115d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 34215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 343db7d25eeSGreg Roach */ 344c1010edaSGreg Roach public function testBornScotlandCensusWales() 345c1010edaSGreg Roach { 346c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 34716d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Edinburgh, Scotland')); 348db7d25eeSGreg Roach 349c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 350db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Wales'); 351db7d25eeSGreg Roach 352ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 353db7d25eeSGreg Roach 354342dcecdSGreg Roach $this->assertSame('S', $column->generate($individual, $individual)); 355db7d25eeSGreg Roach } 356db7d25eeSGreg Roach 357db7d25eeSGreg Roach /** 35815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 35915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 360db7d25eeSGreg Roach */ 361c1010edaSGreg Roach public function testBornIrelandCensusWales() 362c1010edaSGreg Roach { 363c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 36416d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Dublin, Ireland')); 365db7d25eeSGreg Roach 366c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 367db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Wales'); 368db7d25eeSGreg Roach 369ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 370db7d25eeSGreg Roach 371342dcecdSGreg Roach $this->assertSame('I', $column->generate($individual, $individual)); 372db7d25eeSGreg Roach } 373db7d25eeSGreg Roach 374db7d25eeSGreg Roach /** 37515d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 37615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 377db7d25eeSGreg Roach */ 378c1010edaSGreg Roach public function testBornForeignCensusWales() 379c1010edaSGreg Roach { 380c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 38116d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('Elbonia')); 382db7d25eeSGreg Roach 383c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 384db7d25eeSGreg Roach $census->shouldReceive('censusPlace')->andReturn('Wales'); 385db7d25eeSGreg Roach 386ef21b467SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 387db7d25eeSGreg Roach 388342dcecdSGreg Roach $this->assertSame('F', $column->generate($individual, $individual)); 389db7d25eeSGreg Roach } 390b164ca57SGreg Roach 391b164ca57SGreg Roach /** 39215d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 39315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 394b164ca57SGreg Roach */ 395c1010edaSGreg Roach public function testBornNowhereCensusEngland() 396c1010edaSGreg Roach { 397b164ca57SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 39816d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('')); 399b164ca57SGreg Roach 400b164ca57SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 401b164ca57SGreg Roach $census->shouldReceive('censusPlace')->andReturn('England'); 402b164ca57SGreg Roach 403b164ca57SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 404b164ca57SGreg Roach 405342dcecdSGreg Roach $this->assertSame('', $column->generate($individual, $individual)); 406b164ca57SGreg Roach } 407b164ca57SGreg Roach 408b164ca57SGreg Roach /** 40915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 41015d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 411b164ca57SGreg Roach */ 412c1010edaSGreg Roach public function testBornNowhereCensusWales() 413c1010edaSGreg Roach { 414b164ca57SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 41516d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('')); 416b164ca57SGreg Roach 417b164ca57SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 418b164ca57SGreg Roach $census->shouldReceive('censusPlace')->andReturn('Wales'); 419b164ca57SGreg Roach 420b164ca57SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 421b164ca57SGreg Roach 422342dcecdSGreg Roach $this->assertSame('', $column->generate($individual, $individual)); 423b164ca57SGreg Roach } 424b164ca57SGreg Roach 425b164ca57SGreg Roach /** 42615d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts 42715d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 428b164ca57SGreg Roach */ 429c1010edaSGreg Roach public function testBornNowhereCensusScotland() 430c1010edaSGreg Roach { 431b164ca57SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 43216d0b7f7SRico Sonntag $individual->shouldReceive('getBirthPlace')->andReturn($this->getPlaceMock('')); 433b164ca57SGreg Roach 434b164ca57SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 435b164ca57SGreg Roach $census->shouldReceive('censusPlace')->andReturn('Scotland'); 436b164ca57SGreg Roach 437b164ca57SGreg Roach $column = new CensusColumnBornForeignParts($census, '', ''); 438b164ca57SGreg Roach 439342dcecdSGreg Roach $this->assertSame('', $column->generate($individual, $individual)); 440b164ca57SGreg Roach } 441db7d25eeSGreg Roach} 442