. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\Date\GregorianDate; use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\TestCase; use PHPUnit\Framework\Attributes\CoversClass; #[CoversClass(CensusColumnBirthYear::class)] #[CoversClass(AbstractCensusColumn::class)] class CensusColumnBirthYearTest extends TestCase { public function testGenerateColumn(): void { $cal_date = $this->createMock(GregorianDate::class); $cal_date->method('format')->willReturn('1800'); $date = $this->createMock(Date::class); $date->method('minimumDate')->willReturn($cal_date); $individual = $this->createMock(Individual::class); $individual->method('getEstimatedBirthDate')->willReturn($date); $census = $this->createMock(CensusInterface::class); $census->method('censusDate')->willReturn('30 JUN 1832'); $column = new CensusColumnBirthYear($census, '', ''); self::assertSame('1800', $column->generate($individual, $individual)); } }