Added check for empty activity time

This commit is contained in:
Justin Foell
2021-05-28 11:43:45 -05:00
parent 41bd58b93b
commit b18bafdd5b
3 changed files with 22 additions and 3 deletions
+12
View File
@@ -96,6 +96,18 @@ class WPStrava_SOMEnglishTest extends TestCase {
$this->assertEquals( '61:24:31', $this->som->time( 221071 ) );
}
/**
* Test that null or empty seconds input will return an empty string (not an exception).
*
* @author Justin Foell <justin@foell.org>
* @since 2.9.1
*/
public function test_time_empty() {
$this->assertEquals( '', $this->som->time( '' ) );
$this->assertEquals( '', $this->som->time( null ) );
$this->assertEquals( '', $this->som->time( 0 ) );
}
/**
* Test that 1304 calories is 1,304 using both string and int inputs.
*