. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\TestCase; /** * Test harness for the class CensusColumnSexF * * X is the value expected for Female, as only the M or F column is expected * to be marked. */ class CensusColumnSexFTest extends TestCase { /** * @covers \Fisharebest\Webtrees\Census\CensusColumnSexF * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn * * @return void */ public function testMale(): void { $individual = $this->createMock(Individual::class); $individual->method('sex')->willReturn('M'); $census = $this->createMock(CensusInterface::class); $column = new CensusColumnSexF($census, '', ''); self::assertSame('', $column->generate($individual, $individual)); } /** * @covers \Fisharebest\Webtrees\Census\CensusColumnSexF * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn * * @return void */ public function testFeale(): void { $individual = $this->createMock(Individual::class); $individual->method('sex')->willReturn('F'); $census = $this->createMock(CensusInterface::class); $column = new CensusColumnSexF($census, '', ''); self::assertSame('X', $column->generate($individual, $individual)); } /** * @covers \Fisharebest\Webtrees\Census\CensusColumnSexF * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn * * @return void */ public function testUnknownSex(): void { $individual = $this->createMock(Individual::class); $individual->method('sex')->willReturn('U'); $census = $this->createMock(CensusInterface::class); $column = new CensusColumnSexF($census, '', ''); self::assertSame('', $column->generate($individual, $individual)); } }