Skip to content

Commit

Permalink
Test total using UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Oct 30, 2024
1 parent 5040f29 commit 3433808
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/CarbonInterval/TotalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Carbon\Carbon;
use Carbon\CarbonInterval;
use DateTimeImmutable;
use Generator;
use InvalidArgumentException;
use PHPUnit\Framework\Attributes\DataProvider;
Expand Down Expand Up @@ -294,6 +295,8 @@ public function testAlterationAfterDiff()

public function testAbsoluteDiff()
{
Carbon::setTestNowAndTimezone(new DateTimeImmutable('now UTC'));

$diff = Carbon::now()->addDays(15)->diff('now');

$this->assertSame(-1296000000000.0, $diff->totalMicroseconds);
Expand Down

0 comments on commit 3433808

Please sign in to comment.