. */ namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\Individual; use Mockery; /** * Test harness for the class CensusColumnMotherBirthPlaceSimple */ class CensusColumnMotherBirthPlaceSimpleTest extends \PHPUnit_Framework_TestCase { /** * Delete mock objects */ public function tearDown() { Mockery::close(); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnMotherBirthPlaceSimple * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn */ public function testKnownStateAndTown() { $father = Mockery::mock(Individual::class); $father->shouldReceive('getBirthPlace')->andReturn('Miami, Florida, United States'); $family = Mockery::mock(Family::class); $family->shouldReceive('getWife')->andReturn($father); $individual = Mockery::mock(Individual::class); $individual->shouldReceive('getPrimaryChildFamily')->andReturn($family); $census = Mockery::mock(CensusInterface::class); $census->shouldReceive('censusPlace')->andReturn('United States'); $column = new CensusColumnMotherBirthPlaceSimple($census, '', ''); $this->assertSame('Florida', $column->generate($individual)); } }