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