. */ namespace Fisharebest\Webtrees\Census; use Mockery; /** * Test harness for the class CensusColumnFullName */ class CensusColumnFullNameTest extends \PHPUnit_Framework_TestCase { /** * Delete mock objects */ public function tearDown() { Mockery::close(); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnFullName * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testFullName() { $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); $individual->shouldReceive('getAllNames')->andReturn(array(array('full' => 'Joe Bloggs'))); $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); $census->shouldReceive('censusDate')->andReturn(''); $column = new CensusColumnFullName($census, '', ''); $this->assertSame('Joe Bloggs', $column->generate($individual)); } }