Exemplo n.º 1
0
 /**
  * Add GPX to object
  */
 protected function addGPXtoObject()
 {
     if ($this->GPXImporter->failed()) {
         return;
     }
     foreach ($this->GPXImporter->object()->getArray() as $key => $value) {
         if ($this->TrainingObject->get($key) == '' || $this->TrainingObject->get($key) == 0) {
             $this->setFromGPX($key, $value);
         }
     }
     if (!$this->TrainingObject->Splits()->areEmpty()) {
         $this->fillSplitsFromGPX();
     }
 }
Exemplo n.º 2
0
 /**
  * Test: standard route
  * Filename: "Route-only.gpx" 
  */
 public function testStandardGPXroute()
 {
     $this->object->parseFile('../tests/testfiles/gpx/Route-only.gpx');
     $this->assertFalse($this->object->hasMultipleTrainings());
     $this->assertFalse($this->object->failed());
     $this->assertEquals(0.4, $this->object->object()->getDistance(), '', 0.05);
     $this->assertTrue($this->object->object()->hasArrayAltitude());
     $this->assertTrue($this->object->object()->hasArrayDistance());
     $this->assertTrue($this->object->object()->hasArrayLatitude());
     $this->assertTrue($this->object->object()->hasArrayLongitude());
 }