Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Time loses microseconds #9081

Merged
merged 15 commits into from
Jul 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: add tests for Time::isBefore() and isAfter() with same time
kenjis committed Jul 31, 2024

Verified

This commit was signed with the committer’s verified signature.
kenjis kenjis
commit d4cf9bc20f98667d6e24e4a051a8d98bf621b288
18 changes: 18 additions & 0 deletions tests/system/I18n/TimeTest.php
Original file line number Diff line number Diff line change
@@ -936,6 +936,15 @@ public function testBefore(): void
$this->assertFalse($time2->isBefore($time1));
}

public function testBeforeSameTime(): void
{
$time1 = new Time('2024-01-01 12:00:00.000000');
$time2 = new Time('2024-01-01 12:00:00.000000');

$this->assertFalse($time1->isBefore($time2));
$this->assertFalse($time2->isBefore($time1));
}

public function testBeforeWithMicroseconds(): void
{
$time1 = new Time('2024-01-01 12:00:00.000000');
@@ -954,6 +963,15 @@ public function testAfter(): void
$this->assertTrue($time2->isAfter($time1));
}

public function testAfterSameTime(): void
{
$time1 = new Time('2024-01-01 12:00:00.000000');
$time2 = new Time('2024-01-01 12:00:00.000000');

$this->assertFalse($time1->isAfter($time2));
$this->assertFalse($time2->isAfter($time1));
}

public function testAfterWithMicroseconds(): void
{
$time1 = new Time('2024-01-01 12:00:00.654321');