. */ namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\Individual; use Mockery; /** * Test harness for the class CensusColumnBirthDaySlashMonthTest */ class CensusColumnBirthDaySlashMonthTest extends \PHPUnit_Framework_TestCase { /** * Delete mock objects */ public function tearDown() { Mockery::close(); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnBirthDaySlashMonthTest * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testGenerateColumn() { $cal_date = Mockery::mock(Date\CalendarDate::class); $cal_date->shouldReceive('format')->andReturn('30/6'); $date = Mockery::mock(Date::class); $date->shouldReceive('minimumJulianDay')->andReturn($cal_date); $date->shouldReceive('maximumJulianDay')->andReturn($cal_date); $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 CensusColumnBirthDaySlashMonth($census, '', ''); $this->assertSame('30/6', $column->generate($individual)); } }