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