File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,15 @@ public function testValidUsername(): void
5656 // test length of longest streak matches time between start and end dates
5757 $ longestStreakDelta = strtotime ($ stats ["longestStreak " ]["end " ]) - strtotime ($ stats ["longestStreak " ]["start " ]);
5858 $ this ->assertEquals ($ longestStreakDelta / 60 / 60 / 24 + 1 , $ stats ["longestStreak " ]["length " ]);
59+ // if the current streak is 0, the start date should be the same as the end date
60+ if ($ stats ["currentStreak " ]["length " ] == 0 ) {
61+ $ this ->assertEquals ($ stats ["currentStreak " ]["start " ], $ stats ["currentStreak " ]["end " ]);
62+ }
5963 // test length of current streak matches time between start and end dates
60- $ currentStreakDelta = strtotime ($ stats ["currentStreak " ]["end " ]) - strtotime ($ stats ["currentStreak " ]["start " ]);
61- $ this ->assertEquals ($ currentStreakDelta / 60 / 60 / 24 + 1 , $ stats ["currentStreak " ]["length " ]);
64+ else {
65+ $ currentStreakDelta = strtotime ($ stats ["currentStreak " ]["end " ]) - strtotime ($ stats ["currentStreak " ]["start " ]);
66+ $ this ->assertEquals ($ currentStreakDelta / 60 / 60 / 24 + 1 , $ stats ["currentStreak " ]["length " ]);
67+ }
6268 }
6369
6470 /**
You can’t perform that action at this time.
0 commit comments