. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\TestCase; use PHPUnit\Framework\Attributes\CoversClass; #[CoversClass(CensusColumnSurname::class)] #[CoversClass(AbstractCensusColumn::class)] class CensusColumnSurnameTest extends TestCase { public function testSurname(): void { $individual = $this->createMock(Individual::class); $individual->method('getAllNames')->willReturn([['surname' => 'Bloggs']]); $census = $this->createMock(CensusInterface::class); $column = new CensusColumnSurname($census, '', ''); self::assertSame('Bloggs', $column->generate($individual, $individual)); } public function testNoName(): void { $individual = $this->createMock(Individual::class); $individual->method('getAllNames')->willReturn([]); $census = $this->createMock(CensusInterface::class); $column = new CensusColumnSurname($census, '', ''); self::assertSame('', $column->generate($individual, $individual)); } }