. */ namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\Individual; use Mockery; /** * Test harness for the class CensusColumnAge */ class CensusColumnBirthDateTest extends \PHPUnit_Framework_TestCase { /** * Delete mock objects */ public function tearDown() { Mockery::close(); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnBirthDate * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testGenerateColumn() { $date = Mockery::mock(Date::class); $date->shouldReceive('display')->andReturn('1 January 1800'); $individual = Mockery::mock(Individual::class); $individual->shouldReceive('getEstimatedBirthDate')->andReturn($date); $census = Mockery::mock(CensusInterface::class); $census->shouldReceive('censusDate')->andReturn('30 JUN 1832'); $column = new CensusColumnBirthDate($census, '', ''); $this->assertSame('1 January 1800', $column->generate($individual)); } }