Skip to content

Commit cb0fd28

Browse files
committed
Test total using UTC
1 parent e51a3e8 commit cb0fd28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/CarbonInterval/TotalTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use Carbon\Carbon;
1717
use Carbon\CarbonInterval;
18+
use DateTimeImmutable;
1819
use Generator;
1920
use InvalidArgumentException;
2021
use PHPUnit\Framework\Attributes\DataProvider;
@@ -294,6 +295,8 @@ public function testAlterationAfterDiff()
294295

295296
public function testAbsoluteDiff()
296297
{
298+
Carbon::setTestNowAndTimezone(new DateTimeImmutable('now UTC'));
299+
297300
$diff = Carbon::now()->addDays(15)->diff('now');
298301

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

0 commit comments

Comments
 (0)