File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -936,6 +936,15 @@ public function testBefore(): void
936936 $ this ->assertFalse ($ time2 ->isBefore ($ time1 ));
937937 }
938938
939+ public function testBeforeWithMicroseconds (): void
940+ {
941+ $ time1 = new Time ('2024-01-01 12:00:00.000000 ' );
942+ $ time2 = new Time ('2024-01-01 12:00:00.654321 ' );
943+
944+ $ this ->assertTrue ($ time1 ->isBefore ($ time2 ));
945+ $ this ->assertFalse ($ time2 ->isBefore ($ time1 ));
946+ }
947+
939948 public function testAfter (): void
940949 {
941950 $ time1 = Time::parse ('January 10, 2017 21:50:00 ' , 'America/Chicago ' );
@@ -945,6 +954,15 @@ public function testAfter(): void
945954 $ this ->assertTrue ($ time2 ->isAfter ($ time1 ));
946955 }
947956
957+ public function testAfterWithMicroseconds (): void
958+ {
959+ $ time1 = new Time ('2024-01-01 12:00:00.654321 ' );
960+ $ time2 = new Time ('2024-01-01 12:00:00.000000 ' );
961+
962+ $ this ->assertTrue ($ time1 ->isAfter ($ time2 ));
963+ $ this ->assertFalse ($ time2 ->isAfter ($ time1 ));
964+ }
965+
948966 public function testHumanizeYearsSingle (): void
949967 {
950968 Time::setTestNow ('March 10, 2017 ' , 'America/Chicago ' );
You can’t perform that action at this time.
0 commit comments