. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\TestCase; /** * Test harness for the class CensusColumnGivenNames */ class CensusColumnGivenNamesTest extends TestCase { /** * @covers \Fisharebest\Webtrees\Census\CensusColumnGivenNames * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn * * @return void */ public function testGivenNames(): void { $individual = self::createMock(Individual::class); $individual->method('getAllNames')->willReturn([['givn' => 'Joe']]); $census = self::createMock(CensusInterface::class); $column = new CensusColumnGivenNames($census, '', ''); self::assertSame('Joe', $column->generate($individual, $individual)); } /** * @covers \Fisharebest\Webtrees\Census\CensusColumnGivenNames * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn * * @return void */ public function testNoName(): void { $individual = self::createMock(Individual::class); $individual->method('getAllNames')->willReturn([]); $census = self::createMock(CensusInterface::class); $column = new CensusColumnGivenNames($census, '', ''); self::assertSame('', $column->generate($individual, $individual)); } }