Ejemplo n.º 1
0
 public function testBarcode()
 {
     $location = new Location(0, 0);
     $location->setAltitude(100)->setRelevantText('text');
     $this->assertEquals($location->getLatitude(), 0);
     $this->assertEquals($location->getLongitude(), 0);
     $array = $location->toArray();
 }
Ejemplo n.º 2
0
 private function validateLocation(Location $location)
 {
     if ($this->isBlankOrNull($location->getLatitude())) {
         $this->addError(self::LOCATION_LATITUDE_REQUIRED);
     }
     if (!is_numeric($location->getLatitude())) {
         $this->addError(self::LOCATION_LATITUDE_INVALID);
     }
     if ($this->isBlankOrNull($location->getLongitude())) {
         $this->addError(self::LOCATION_LONGITUDE_REQUIRED);
     }
     if (!is_numeric($location->getLongitude())) {
         $this->addError(self::LOCATION_LONGITUDE_INVALID);
     }
     if (!is_numeric($location->getAltitude()) && null !== $location->getAltitude()) {
         $this->addError(self::LOCATION_ALTITUDE_INVALID);
     }
 }