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