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