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