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