. */ namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Individual; use Mockery; /** * Test harness for the class CensusColumnSexMK */ class CensusColumnSexMKTest extends \PHPUnit_Framework_TestCase { /** * Delete mock objects */ public function tearDown() { Mockery::close(); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnSexMK * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testMale() { $individual = Mockery::mock(Individual::class); $individual->shouldReceive('getSex')->andReturn('M'); $census = Mockery::mock(CensusInterface::class); $column = new CensusColumnSexMK($census, '', ''); $this->assertSame('M', $column->generate($individual)); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnSexMK * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testFeale() { $individual = Mockery::mock(Individual::class); $individual->shouldReceive('getSex')->andReturn('F'); $census = Mockery::mock(CensusInterface::class); $column = new CensusColumnSexMK($census, '', ''); $this->assertSame('K', $column->generate($individual)); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnSexMK * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testUnknownSex() { $individual = Mockery::mock(Individual::class); $individual->shouldReceive('getSex')->andReturn('U'); $census = Mockery::mock(CensusInterface::class); $column = new CensusColumnSexMK($census, '', ''); $this->assertSame('', $column->generate($individual)); } }