-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from cmanon/feature/98-time-exception
Added check for empty activity time
- Loading branch information
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,18 @@ public function test_time_greater24h() { | |
$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 <[email protected]> | ||
* @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. | ||
* | ||
|