xref: /webtrees/tests/app/Census/CensusColumnBornForeignPartsTest.php (revision 15d603e7c7c15d20f055d3d9c38d6b133453c5be)
1db7d25eeSGreg Roach<?php
2db7d25eeSGreg Roach
3db7d25eeSGreg Roach/**
4db7d25eeSGreg Roach * webtrees: online genealogy
56bdf7674SGreg Roach * Copyright (C) 2017 webtrees development team
6db7d25eeSGreg Roach * This program is free software: you can redistribute it and/or modify
7db7d25eeSGreg Roach * it under the terms of the GNU General Public License as published by
8db7d25eeSGreg Roach * the Free Software Foundation, either version 3 of the License, or
9db7d25eeSGreg Roach * (at your option) any later version.
10db7d25eeSGreg Roach * This program is distributed in the hope that it will be useful,
11db7d25eeSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12db7d25eeSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13db7d25eeSGreg Roach * GNU General Public License for more details.
14db7d25eeSGreg Roach * You should have received a copy of the GNU General Public License
15db7d25eeSGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
16db7d25eeSGreg Roach */
17db7d25eeSGreg Roachnamespace Fisharebest\Webtrees\Census;
18db7d25eeSGreg Roach
19db7d25eeSGreg Roachuse Mockery;
20db7d25eeSGreg Roach
21db7d25eeSGreg Roach/**
22db7d25eeSGreg Roach * Test harness for the class CensusColumnBornForeignParts
23db7d25eeSGreg Roach */
24db7d25eeSGreg Roachclass CensusColumnBornForeignPartsTest extends \PHPUnit_Framework_TestCase {
25db7d25eeSGreg Roach	/**
26db7d25eeSGreg Roach	 * Delete mock objects
27db7d25eeSGreg Roach	 */
28db7d25eeSGreg Roach	public function tearDown() {
29db7d25eeSGreg Roach		Mockery::close();
30db7d25eeSGreg Roach	}
31db7d25eeSGreg Roach
32db7d25eeSGreg Roach	/**
33*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
34*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
35db7d25eeSGreg Roach	 */
36db7d25eeSGreg Roach	public function testBornEnglandCensusEngland() {
37c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
38db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('London, England');
39db7d25eeSGreg Roach
40c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
41db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('England');
42db7d25eeSGreg Roach
43ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
44db7d25eeSGreg Roach
45db7d25eeSGreg Roach		$this->assertSame('', $column->generate($individual));
46db7d25eeSGreg Roach	}
47db7d25eeSGreg Roach
48db7d25eeSGreg Roach	/**
49*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
50*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
51db7d25eeSGreg Roach	 */
52db7d25eeSGreg Roach	public function testBornWalesCensusEngland() {
53c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
54db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Cardiff, Wales');
55db7d25eeSGreg Roach
56c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
57db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('England');
58db7d25eeSGreg Roach
59ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
60db7d25eeSGreg Roach
61db7d25eeSGreg Roach		$this->assertSame('', $column->generate($individual));
62db7d25eeSGreg Roach	}
63db7d25eeSGreg Roach
64db7d25eeSGreg Roach	/**
65*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
66*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
67db7d25eeSGreg Roach	 */
68db7d25eeSGreg Roach	public function testBornScotlandCensusEngland() {
69c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
70db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Edinburgh, Scotland');
71db7d25eeSGreg Roach
72c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
73db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('England');
74db7d25eeSGreg Roach
75ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
76db7d25eeSGreg Roach
77db7d25eeSGreg Roach		$this->assertSame('S', $column->generate($individual));
78db7d25eeSGreg Roach	}
79db7d25eeSGreg Roach
80db7d25eeSGreg Roach	/**
81*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
82*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
83db7d25eeSGreg Roach	 */
84db7d25eeSGreg Roach	public function testBornIrelandCensusEngland() {
85c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
86db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Dublin, Ireland');
87db7d25eeSGreg Roach
88c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
89db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('England');
90db7d25eeSGreg Roach
91ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
92db7d25eeSGreg Roach
93db7d25eeSGreg Roach		$this->assertSame('I', $column->generate($individual));
94db7d25eeSGreg Roach	}
95db7d25eeSGreg Roach
96db7d25eeSGreg Roach	/**
97*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
98*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
99db7d25eeSGreg Roach	 */
100db7d25eeSGreg Roach	public function testBornForeignCensusEngland() {
101c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
102db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Elbonia');
103db7d25eeSGreg Roach
104c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
105db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('England');
106db7d25eeSGreg Roach
107ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
108db7d25eeSGreg Roach
109db7d25eeSGreg Roach		$this->assertSame('F', $column->generate($individual));
110db7d25eeSGreg Roach	}
111db7d25eeSGreg Roach
112db7d25eeSGreg Roach	/**
113*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
114*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
115db7d25eeSGreg Roach	 */
116db7d25eeSGreg Roach	public function testBornEnglandCensusIreland() {
117c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
118db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('London, England');
119db7d25eeSGreg Roach
120c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
121db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Ireland');
122db7d25eeSGreg Roach
123ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
124db7d25eeSGreg Roach
125db7d25eeSGreg Roach		$this->assertSame('E', $column->generate($individual));
126db7d25eeSGreg Roach	}
127db7d25eeSGreg Roach
128db7d25eeSGreg Roach	/**
129*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
130*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
131db7d25eeSGreg Roach	 */
132db7d25eeSGreg Roach	public function testBornWalesCensusIreland() {
133c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
134db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Cardiff, Wales');
135db7d25eeSGreg Roach
136c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
137db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Ireland');
138db7d25eeSGreg Roach
139ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
140db7d25eeSGreg Roach
141db7d25eeSGreg Roach		$this->assertSame('E', $column->generate($individual));
142db7d25eeSGreg Roach	}
143db7d25eeSGreg Roach
144db7d25eeSGreg Roach	/**
145*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
146*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
147db7d25eeSGreg Roach	 */
148db7d25eeSGreg Roach	public function testBornScotlandCensusIreland() {
149c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
150db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Edinburgh, Scotland');
151db7d25eeSGreg Roach
152c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
153db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Ireland');
154db7d25eeSGreg Roach
155ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
156db7d25eeSGreg Roach
157db7d25eeSGreg Roach		$this->assertSame('S', $column->generate($individual));
158db7d25eeSGreg Roach	}
159db7d25eeSGreg Roach
160db7d25eeSGreg Roach	/**
161*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
162*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
163db7d25eeSGreg Roach	 */
164db7d25eeSGreg Roach	public function testBornIrelandCensusIreland() {
165c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
166db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Dublin, Ireland');
167db7d25eeSGreg Roach
168c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
169db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Ireland');
170db7d25eeSGreg Roach
171ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
172db7d25eeSGreg Roach
173db7d25eeSGreg Roach		$this->assertSame('', $column->generate($individual));
174db7d25eeSGreg Roach	}
175db7d25eeSGreg Roach
176db7d25eeSGreg Roach	/**
177*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
178*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
179db7d25eeSGreg Roach	 */
180db7d25eeSGreg Roach	public function testBornForeignCensusIreland() {
181c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
182db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Elbonia');
183db7d25eeSGreg Roach
184c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
185db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Ireland');
186db7d25eeSGreg Roach
187ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
188db7d25eeSGreg Roach
189db7d25eeSGreg Roach		$this->assertSame('F', $column->generate($individual));
190db7d25eeSGreg Roach	}
191db7d25eeSGreg Roach
192db7d25eeSGreg Roach	/**
193*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
194*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
195db7d25eeSGreg Roach	 */
196db7d25eeSGreg Roach	public function testBornEnglandCensusScotland() {
197c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
198db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('London, England');
199db7d25eeSGreg Roach
200c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
201db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Scotland');
202db7d25eeSGreg Roach
203ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
204db7d25eeSGreg Roach
205db7d25eeSGreg Roach		$this->assertSame('E', $column->generate($individual));
206db7d25eeSGreg Roach	}
207db7d25eeSGreg Roach
208db7d25eeSGreg Roach	/**
209*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
210*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
211db7d25eeSGreg Roach	 */
212db7d25eeSGreg Roach	public function testBornWalesCensusScotland() {
213c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
214db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Cardiff, Wales');
215db7d25eeSGreg Roach
216c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
217db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Scotland');
218db7d25eeSGreg Roach
219ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
220db7d25eeSGreg Roach
221db7d25eeSGreg Roach		$this->assertSame('E', $column->generate($individual));
222db7d25eeSGreg Roach	}
223db7d25eeSGreg Roach
224db7d25eeSGreg Roach	/**
225*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
226*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
227db7d25eeSGreg Roach	 */
228db7d25eeSGreg Roach	public function testBornScotlandCensusScotland() {
229c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
230db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Edinburgh, Scotland');
231db7d25eeSGreg Roach
232c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
233db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Scotland');
234db7d25eeSGreg Roach
235ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
236db7d25eeSGreg Roach
237db7d25eeSGreg Roach		$this->assertSame('', $column->generate($individual));
238db7d25eeSGreg Roach	}
239db7d25eeSGreg Roach
240db7d25eeSGreg Roach	/**
241*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
242*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
243db7d25eeSGreg Roach	 */
244db7d25eeSGreg Roach	public function testBornIrelandCensusScotland() {
245c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
246db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Dublin, Ireland');
247db7d25eeSGreg Roach
248c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
249db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Scotland');
250db7d25eeSGreg Roach
251ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
252db7d25eeSGreg Roach
253db7d25eeSGreg Roach		$this->assertSame('I', $column->generate($individual));
254db7d25eeSGreg Roach	}
255db7d25eeSGreg Roach
256db7d25eeSGreg Roach	/**
257*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
258*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
259db7d25eeSGreg Roach	 */
260db7d25eeSGreg Roach	public function testBornForeignCensusScotland() {
261c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
262db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Elbonia');
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
269db7d25eeSGreg Roach		$this->assertSame('F', $column->generate($individual));
270db7d25eeSGreg Roach	}
271db7d25eeSGreg Roach
272db7d25eeSGreg Roach	/**
273*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
274*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
275db7d25eeSGreg Roach	 */
276db7d25eeSGreg Roach	public function testBornEnglandCensusWales() {
277c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
278db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('London, England');
279db7d25eeSGreg Roach
280c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
281db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Wales');
282db7d25eeSGreg Roach
283ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
284db7d25eeSGreg Roach
285db7d25eeSGreg Roach		$this->assertSame('', $column->generate($individual));
286db7d25eeSGreg Roach	}
287db7d25eeSGreg Roach
288db7d25eeSGreg Roach	/**
289*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
290*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
291db7d25eeSGreg Roach	 */
292db7d25eeSGreg Roach	public function testBornWalesCensusWales() {
293c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
294db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Cardiff, Wales');
295db7d25eeSGreg Roach
296c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
297db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Wales');
298db7d25eeSGreg Roach
299ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
300db7d25eeSGreg Roach
301db7d25eeSGreg Roach		$this->assertSame('', $column->generate($individual));
302db7d25eeSGreg Roach	}
303db7d25eeSGreg Roach
304db7d25eeSGreg Roach	/**
305*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
306*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
307db7d25eeSGreg Roach	 */
308db7d25eeSGreg Roach	public function testBornScotlandCensusWales() {
309c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
310db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Edinburgh, Scotland');
311db7d25eeSGreg Roach
312c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
313db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Wales');
314db7d25eeSGreg Roach
315ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
316db7d25eeSGreg Roach
317db7d25eeSGreg Roach		$this->assertSame('S', $column->generate($individual));
318db7d25eeSGreg Roach	}
319db7d25eeSGreg Roach
320db7d25eeSGreg Roach	/**
321*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
322*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
323db7d25eeSGreg Roach	 */
324db7d25eeSGreg Roach	public function testBornIrelandCensusWales() {
325c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
326db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Dublin, Ireland');
327db7d25eeSGreg Roach
328c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
329db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Wales');
330db7d25eeSGreg Roach
331ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
332db7d25eeSGreg Roach
333db7d25eeSGreg Roach		$this->assertSame('I', $column->generate($individual));
334db7d25eeSGreg Roach	}
335db7d25eeSGreg Roach
336db7d25eeSGreg Roach	/**
337*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
338*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
339db7d25eeSGreg Roach	 */
340db7d25eeSGreg Roach	public function testBornForeignCensusWales() {
341c314ecc9SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
342db7d25eeSGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('Elbonia');
343db7d25eeSGreg Roach
344c314ecc9SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
345db7d25eeSGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Wales');
346db7d25eeSGreg Roach
347ef21b467SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
348db7d25eeSGreg Roach
349db7d25eeSGreg Roach		$this->assertSame('F', $column->generate($individual));
350db7d25eeSGreg Roach	}
351b164ca57SGreg Roach
352b164ca57SGreg Roach	/**
353*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
354*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
355b164ca57SGreg Roach	 */
356b164ca57SGreg Roach	public function testBornNowhereCensusEngland() {
357b164ca57SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
358b164ca57SGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('');
359b164ca57SGreg Roach
360b164ca57SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
361b164ca57SGreg Roach		$census->shouldReceive('censusPlace')->andReturn('England');
362b164ca57SGreg Roach
363b164ca57SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
364b164ca57SGreg Roach
365b164ca57SGreg Roach		$this->assertSame('', $column->generate($individual));
366b164ca57SGreg Roach	}
367b164ca57SGreg Roach
368b164ca57SGreg Roach	/**
369*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
370*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
371b164ca57SGreg Roach	 */
372b164ca57SGreg Roach	public function testBornNowhereCensusWales() {
373b164ca57SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
374b164ca57SGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('');
375b164ca57SGreg Roach
376b164ca57SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
377b164ca57SGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Wales');
378b164ca57SGreg Roach
379b164ca57SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
380b164ca57SGreg Roach
381b164ca57SGreg Roach		$this->assertSame('', $column->generate($individual));
382b164ca57SGreg Roach	}
383b164ca57SGreg Roach
384b164ca57SGreg Roach	/**
385*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\CensusColumnBornForeignParts
386*15d603e7SGreg Roach	 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn
387b164ca57SGreg Roach	 */
388b164ca57SGreg Roach	public function testBornNowhereCensusScotland() {
389b164ca57SGreg Roach		$individual = Mockery::mock('Fisharebest\Webtrees\Individual');
390b164ca57SGreg Roach		$individual->shouldReceive('getBirthPlace')->andReturn('');
391b164ca57SGreg Roach
392b164ca57SGreg Roach		$census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
393b164ca57SGreg Roach		$census->shouldReceive('censusPlace')->andReturn('Scotland');
394b164ca57SGreg Roach
395b164ca57SGreg Roach		$column = new CensusColumnBornForeignParts($census, '', '');
396b164ca57SGreg Roach
397b164ca57SGreg Roach		$this->assertSame('', $column->generate($individual));
398b164ca57SGreg Roach	}
399db7d25eeSGreg Roach}
400