/** * @param string $hrmFile * @param string $gpxFile * @return \ImporterHRMandGPX */ protected function loadFiles($hrmFile, $gpxFile) { $HRMimporter = new ImporterFiletypeHRM(); $HRMimporter->parseFile($hrmFile); $GPXimporter = new ImporterFiletypeGPX(); $GPXimporter->parseFile($gpxFile); return new ImporterHRMandGPX($HRMimporter, $GPXimporter); }
/** * 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()); }
/** * Import hrm and gpx * @param string $filename relative path */ private function importHRMandGPX($filename) { $HRMImporter = new ImporterFiletypeHRM(); $HRMImporter->parseFile($filename . '.hrm'); $GPXImporter = new ImporterFiletypeGPX(); $GPXImporter->parseFile($filename . '.gpx'); $Importer = new ImporterHRMandGPX($HRMImporter, $GPXImporter); $this->TrainingObjects[] = $Importer->object(); $this->addErrors($HRMImporter->getErrors()); $this->addErrors($GPXImporter->getErrors()); unlink(FRONTEND_PATH . $filename . '.hrm'); unlink(FRONTEND_PATH . $filename . '.gpx'); }