public function testZonePlanFunctions()
 {
     $addressAesch = $this->init->createTestAddressAesch();
     $zone = Zone::createUnclassifiedZone('Fernfahrt');
     $this->init->zoneRepo->store($zone);
     $zone = Zone::registerZone('kantonal123456', 2);
     $this->init->zoneRepo->store($zone);
     $zonePlan = ZonePlan::registerZonePlan('habakuck', '3231');
     $zonePlan->setZone($zone);
     $this->init->zonePlanRepo->store($zonePlan);
     $this->init->em->flush();
     $this->assertTrue($this->init->zoneRepo->checkIfNameAlreadyExist('kantonal123456'));
     $zoneAdd = $this->init->zonePlanManagement->getZoneForAddress($addressAesch);
     $this->assertNotNull($zoneAdd);
     $zoneCity = $this->init->zonePlanManagement->getZoneForCity('habakuck');
     $this->assertNotNull($zoneCity);
 }
 /**
  * @return Zone
  */
 private function getUnclassifiedZone()
 {
     /**
      * get zone with the highest priority (unclassified zones)
      * if the zone doen't exist, create and persist it
      * output: unclassified zone
      * note:   Fernfahrt == zone.unclassified (for testing only)
      */
     /** @var $oldZone Zone */
     $oldZone = $this->zoneRepository->findUnclassifiedZone();
     if (!is_null($oldZone)) {
         return $oldZone;
     }
     /** @var $newZone Zone */
     $newZone = Zone::createUnclassifiedZone('Fernfahrt');
     $this->zoneRepository->store($newZone);
     $this->getContainer()->get('entity_manager')->flush();
     return $this->zoneRepository->findUnclassifiedZone();
 }