/** * 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(); } }
/** * 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()); }