Skip to content

Commit 426d0bc

Browse files
authored
Merge pull request #52233 from timacdonald/fix-tests
[11.x] Support lower version of Carbon
2 parents a13b726 + 65823de commit 426d0bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/Foundation/Testing/WormholeTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Carbon\CarbonImmutable;
66
use Illuminate\Foundation\Testing\Wormhole;
7+
use Illuminate\Support\Carbon;
78
use Illuminate\Support\Facades\Date;
89
use PHPUnit\Framework\TestCase;
910

@@ -53,13 +54,14 @@ public function testCarbonImmutableCompatibility()
5354

5455
public function testItCanTravelByMicroseconds()
5556
{
56-
Date::use(CarbonImmutable::class);
57-
Date::setTestNow(Date::parse('2000-01-01 00:00:00')->startOfSecond());
57+
Carbon::setTestNow(Carbon::parse('2000-01-01 00:00:00')->startOfSecond());
5858

5959
(new Wormhole(1))->microsecond();
6060
$this->assertSame('2000-01-01 00:00:00.000001', Date::now()->format('Y-m-d H:i:s.u'));
6161

6262
(new Wormhole(5))->microseconds();
6363
$this->assertSame('2000-01-01 00:00:00.000006', Date::now()->format('Y-m-d H:i:s.u'));
64+
65+
Carbon::setTestnow();
6466
}
6567
}

0 commit comments

Comments
 (0)