public function testGetSetCounty() { $expected = new County('CODE', 'NAME'); $this->assertEmpty($this->instance->getCounty()); $this->assertEmpty($this->instance->getCountyName()); $this->assertInstanceOf(Authority::class, $this->instance->setCounty($expected)); $this->assertEquals($expected, $this->instance->getCounty()); $this->assertEquals($expected->getCountyName(), $this->instance->getCountyName()); }
/** * @param ObjectManager $manager * @return LoadTestPostCodes */ protected function loadPostCodeInNewcastle(ObjectManager $manager) { $url = "newcastle.gov.uk"; $auth = new Authority(); $dc = new DistrictCouncil('E08000021', 'Newcastle upon Tyne'); $ew = new ElectoralWard('E05001111', 'Westgate'); $dc->setWebsite($url); $auth->setDistrictCouncil($dc); $auth->setCountry('England'); $auth->setCounty($this->englandGlobalCounty); $auth->setElectoralWard($ew); $auth->setPostcode("NE1 7RS"); $manager->persist($auth); $manager->flush(); return $this; }
/** * @param Authority $updateAuthority * @param Authority $baseAuthority */ protected function updateCounty(Authority $updateAuthority, Authority &$baseAuthority) { if ($updateAuthority->getCounty() instanceof County) { $baseAuthority->setCounty($updateAuthority->getCounty()); } }
/** * @param string $countyCode * @param Authority $authority * @return Authority */ protected function addCountyToAuthority($countyCode, Authority $authority) { $county = $this->getCountyService()->findByEntityCode(new County($countyCode, '')); if ($county instanceof County) { $authority->setCounty($county); } return $authority; }