/** * Test: Suunto file * Filename: "Suunto-Ambit-with-laps-reduced.xml" */ public function test_SuuntoFile_withLaps() { $this->object->parseFile('../tests/testfiles/xml/Suunto-Ambit-with-laps-reduced.xml'); $this->assertFalse($this->object->failed()); $this->assertFalse($this->object->hasMultipleTrainings()); $this->assertEquals(mktime(16, 17, 22, 4, 26, 2014), $this->object->object()->getTimestamp()); $this->assertEquals(5.013, $this->object->object()->getDistance()); $this->assertEquals(1551, $this->object->object()->getTimeInSeconds()); $this->assertEquals(648, $this->object->object()->getElapsedTime()); $this->assertEquals(112, $this->object->object()->getPulseAvg()); $this->assertEquals(123, $this->object->object()->getPulseMax()); $this->assertEquals(25, $this->object->object()->get('temperature')); $this->assertEquals(361, $this->object->object()->getCalories()); $this->assertTrue($this->object->object()->hasArrayHeartrate()); $this->assertTrue($this->object->object()->hasArrayAltitude()); $this->assertTrue($this->object->object()->hasArrayDistance()); $this->assertTrue($this->object->object()->hasArrayLatitude()); $this->assertTrue($this->object->object()->hasArrayLongitude()); $this->assertTrue($this->object->object()->hasArrayTemperature()); $this->assertTrue($this->object->object()->hasArrayTime()); $this->assertEquals(0.08500000000000001, $this->object->object()->getArrayDistanceLastPoint()); // New: Cadence && Laps $this->assertTrue($this->object->object()->hasArrayCadence()); $this->assertEquals(87, $this->object->object()->getCadence()); $this->assertEquals(array(81, 87, 88, 88, 88, 87, 88), $this->object->object()->getArrayCadence()); $this->assertFalse($this->object->object()->Splits()->areEmpty()); $this->assertEquals("1.00|5:33-1.00|5:16", $this->object->object()->Splits()->asString()); }
/** * Test: Suunto Ambit3 with only RR data * Filename: "Suunto-Ambit3-only-RR-reduced.sml" */ public function testSuuntoAmbit3withOnlyRRdata() { $this->object->parseFile('../tests/testfiles/sml/Suunto-Ambit3-only-RR-reduced.sml'); $this->assertTrue($this->object->object()->hasArrayHeartrate()); // Only the first samples up to 0.106 km are available // Header data does not match anymore $this->assertEquals(117, $this->object->object()->getPulseAvg(), '', 0); $this->assertEquals(131, $this->object->object()->getPulseMax(), '', 0); $this->assertTrue($this->object->object()->hasArrayHRV()); }
/** * 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. }