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