/** * Test: RunningAHEAD log * Filename: "RunningAHEAD-Minimal-example.xml" */ public function test_RunningAHEADFile() { $this->object->parseFile('../tests/testfiles/xml/RunningAHEAD-Minimal-example.xml'); $this->assertFalse($this->object->failed()); $this->assertTrue($this->object->hasMultipleTrainings()); $this->assertEquals(3, $this->object->numberOfTrainings()); // Event 1 $this->assertEquals(193, $this->object->object(0)->getPulseAvg()); $this->assertEquals(210, $this->object->object(0)->getPulseMax()); $this->assertEquals(5.0, $this->object->object(0)->getDistance()); $this->assertEquals(1157, $this->object->object(0)->getTimeInSeconds()); $this->assertEquals("Citylauf Telgte", $this->object->object(0)->getRoute()); $this->assertEquals(17, $this->object->object(0)->get('temperature')); $this->assertEquals(\Runalyze\Data\Weather\Condition::SUNNY, $this->object->object(0)->get('weatherid')); $this->assertEquals("Super organisiert, gute Strecke ...", $this->object->object(0)->getNotes()); // Event 2 $this->assertEquals(1.0, $this->object->object(1)->getDistance()); $this->assertEquals(2700, $this->object->object(1)->getTimeInSeconds()); // Event 3 $this->assertEquals(182, $this->object->object(2)->getPulseAvg()); $this->assertEquals(189, $this->object->object(2)->getPulseMax()); $this->assertEquals(4.0, $this->object->object(2)->getDistance()); $this->assertEquals(1000, $this->object->object(2)->getTimeInSeconds()); $this->assertEquals("Bahn Sentruper Hoehe", $this->object->object(2)->getRoute()); $this->assertEquals("4 x 1 km, 400 m Trab", $this->object->object(2)->getComment()); $this->assertEquals(15, $this->object->object(2)->get('temperature')); $this->assertEquals(\Runalyze\Data\Weather\Condition::SUNNY, $this->object->object(0)->get('weatherid')); $this->assertEquals("1.00|4:10-R0.40|3:00-1.00|4:10-R0.40|3:00-1.00|4:10-R0.40|3:00-1.00|4:10-R1.60|8:00", $this->object->object(2)->Splits()->asString()); }
/** * Test: Polar file * Filename: "test.logbook" */ public function test_StandardFile() { $this->object->parseFile('../tests/testfiles/sporttracks/test.logbook'); $this->assertFalse($this->object->failed()); $this->assertTrue($this->object->hasMultipleTrainings()); $this->assertEquals(5, $this->object->numberOfTrainings()); // Activity 1 $this->assertEquals(mktime(18, 1, 44, 9, 6, 2008), $this->object->object(0)->getTimestamp()); $this->assertEquals(Configuration::General()->runningSport(), $this->object->object(0)->get('sportid')); $this->assertEquals(9382, $this->object->object(0)->getTimeInSeconds()); $this->assertEquals(26.743, $this->object->object(0)->getDistance()); $this->assertEquals(943, $this->object->object(0)->getCalories()); $this->assertEquals("Buxtehuder Abendlauf", $this->object->object(0)->getComment()); $this->assertEquals("Buxtehude", $this->object->object(0)->getRoute()); $this->assertEquals("20°C\r\n1-2 Bft", $this->object->object(0)->getNotes()); // Activity 2 $this->assertEquals(mktime(15, 3, 28, 3, 28, 2009), $this->object->object(1)->getTimestamp()); $this->assertEquals(Configuration::General()->runningSport(), $this->object->object(1)->get('sportid')); $this->assertEquals(10837, $this->object->object(1)->getTimeInSeconds()); $this->assertEquals(25.864, $this->object->object(1)->getDistance()); $this->assertEquals(365, $this->object->object(1)->getElevation()); $this->assertEquals(156, $this->object->object(1)->getPulseAvg()); $this->assertEquals(167, $this->object->object(1)->getPulseMax()); $this->assertEquals("mit Michael Kuthe", $this->object->object(1)->getComment()); $this->assertEquals("Horneburg-Helmste-Harsefeld-Bliedersdorf", $this->object->object(1)->getRoute()); $this->assertEquals("Erster Lauf mit der Forerunner 305 ;o)", $this->object->object(1)->getNotes()); $this->assertEquals(true, $this->object->object(1)->Splits()->areEmpty()); // Activity 2 $this->assertEquals(mktime(20, 22, 49, 3, 31, 2009), $this->object->object(2)->getTimestamp()); $this->assertEquals(Configuration::General()->runningSport(), $this->object->object(2)->get('sportid')); $this->assertEquals(2310, $this->object->object(2)->getTimeInSeconds()); $this->assertEquals(6.904, $this->object->object(2)->getDistance()); $this->assertEquals("Horneburg Winterrunde", $this->object->object(2)->getRoute()); $this->assertEquals(false, $this->object->object(2)->Splits()->areEmpty()); $this->assertEquals('1.00|5:37-1.00|5:38-1.00|5:43-1.00|5:38-1.00|5:37-1.00|5:19-0.90|4:56', $this->object->object(2)->Splits()->asString()); // Nothing interesting in the other activities. }