. */ namespace Fisharebest\Webtrees\Census; use Mockery; /** * Test harness for the class CensusColumnAge */ class CensusColumnBirthMonthTest extends \PHPUnit\Framework\TestCase { /** * Delete mock objects */ public function tearDown() { Mockery::close(); } /** * @covers \Fisharebest\Webtrees\Census\CensusColumnBirthMonth * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testGenerateColumn() { $cal_date = Mockery::mock('Fisharebest\Webtrees\Date\CalendarDate'); $cal_date->shouldReceive('format')->andReturn('Jan'); $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 CensusColumnBirthMonth($census, '', ''); $this->assertSame('Jan', $column->generate($individual)); } }