From 21b7de5fc387678c25f8f771a2fc102ae34789f7 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Tue, 23 Jul 2024 09:09:34 +1000 Subject: [PATCH] Support lower version of Carbon --- tests/Foundation/Testing/WormholeTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Foundation/Testing/WormholeTest.php b/tests/Foundation/Testing/WormholeTest.php index 17f286d7e377..84a38039b567 100644 --- a/tests/Foundation/Testing/WormholeTest.php +++ b/tests/Foundation/Testing/WormholeTest.php @@ -4,6 +4,7 @@ use Carbon\CarbonImmutable; use Illuminate\Foundation\Testing\Wormhole; +use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; use PHPUnit\Framework\TestCase; @@ -49,8 +50,7 @@ public function testCarbonImmutableCompatibility() public function testItCanTravelByMicroseconds() { - Date::use(CarbonImmutable::class); - Date::setTestNow(Date::parse('2000-01-01 00:00:00')->startOfSecond()); + Carbon::setTestNow(Carbon::parse('2000-01-01 00:00:00')->startOfSecond()); (new Wormhole(1))->microsecond(); $this->assertSame('2000-01-01 00:00:00.000001', Date::now()->format('Y-m-d H:i:s.u')); @@ -58,6 +58,6 @@ public function testItCanTravelByMicroseconds() (new Wormhole(5))->microseconds(); $this->assertSame('2000-01-01 00:00:00.000006', Date::now()->format('Y-m-d H:i:s.u')); - Date::useDefault(); + Carbon::setTestnow(); } }