14c219c47SGreg Roach<?php 24c219c47SGreg Roach 34c219c47SGreg Roach/** 44c219c47SGreg Roach * webtrees: online genealogy 5*1062a142SGreg Roach * Copyright (C) 2018 webtrees development team 64c219c47SGreg Roach * This program is free software: you can redistribute it and/or modify 74c219c47SGreg Roach * it under the terms of the GNU General Public License as published by 84c219c47SGreg Roach * the Free Software Foundation, either version 3 of the License, or 94c219c47SGreg Roach * (at your option) any later version. 104c219c47SGreg Roach * This program is distributed in the hope that it will be useful, 114c219c47SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 124c219c47SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 134c219c47SGreg Roach * GNU General Public License for more details. 144c219c47SGreg Roach * You should have received a copy of the GNU General Public License 154c219c47SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 164c219c47SGreg Roach */ 174c219c47SGreg Roachnamespace Fisharebest\Webtrees\Census; 184c219c47SGreg Roach 194c219c47SGreg Roachuse Mockery; 204c219c47SGreg Roach 214c219c47SGreg Roach/** 224c219c47SGreg Roach * Test harness for the class CensusColumnSexMK 234c219c47SGreg Roach */ 243e983931SGreg Roachclass CensusColumnSexMKTest extends \PHPUnit\Framework\TestCase { 254c219c47SGreg Roach /** 264c219c47SGreg Roach * Delete mock objects 274c219c47SGreg Roach */ 284c219c47SGreg Roach public function tearDown() { 294c219c47SGreg Roach Mockery::close(); 304c219c47SGreg Roach } 314c219c47SGreg Roach 324c219c47SGreg Roach /** 3315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnSexMK 3415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 354c219c47SGreg Roach */ 364c219c47SGreg Roach public function testMale() { 37c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 384c219c47SGreg Roach $individual->shouldReceive('getSex')->andReturn('M'); 394c219c47SGreg Roach 40c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 414c219c47SGreg Roach 424c219c47SGreg Roach $column = new CensusColumnSexMK($census, '', ''); 434c219c47SGreg Roach 444c219c47SGreg Roach $this->assertSame('M', $column->generate($individual)); 454c219c47SGreg Roach } 464c219c47SGreg Roach 474c219c47SGreg Roach /** 4815d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnSexMK 4915d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 504c219c47SGreg Roach */ 514c219c47SGreg Roach public function testFeale() { 52c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 534c219c47SGreg Roach $individual->shouldReceive('getSex')->andReturn('F'); 544c219c47SGreg Roach 55c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 564c219c47SGreg Roach 574c219c47SGreg Roach $column = new CensusColumnSexMK($census, '', ''); 584c219c47SGreg Roach 594c219c47SGreg Roach $this->assertSame('K', $column->generate($individual)); 604c219c47SGreg Roach } 614c219c47SGreg Roach 624c219c47SGreg Roach /** 6315d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\CensusColumnSexMK 6415d603e7SGreg Roach * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn 654c219c47SGreg Roach */ 664c219c47SGreg Roach public function testUnknownSex() { 67c314ecc9SGreg Roach $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); 684c219c47SGreg Roach $individual->shouldReceive('getSex')->andReturn('U'); 694c219c47SGreg Roach 70c314ecc9SGreg Roach $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); 714c219c47SGreg Roach 724c219c47SGreg Roach $column = new CensusColumnSexMK($census, '', ''); 734c219c47SGreg Roach 744c219c47SGreg Roach $this->assertSame('', $column->generate($individual)); 754c219c47SGreg Roach } 764c219c47SGreg Roach} 77