Skip to content

Commit 21b7de5

Browse files
committed
Support lower version of Carbon
1 parent 9d7c869 commit 21b7de5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/Foundation/Testing/WormholeTest.php

Lines changed: 3 additions & 3 deletions
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

@@ -49,15 +50,14 @@ public function testCarbonImmutableCompatibility()
4950

5051
public function testItCanTravelByMicroseconds()
5152
{
52-
Date::use(CarbonImmutable::class);
53-
Date::setTestNow(Date::parse('2000-01-01 00:00:00')->startOfSecond());
53+
Carbon::setTestNow(Carbon::parse('2000-01-01 00:00:00')->startOfSecond());
5454

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

5858
(new Wormhole(5))->microseconds();
5959
$this->assertSame('2000-01-01 00:00:00.000006', Date::now()->format('Y-m-d H:i:s.u'));
6060

61-
Date::useDefault();
61+
Carbon::setTestnow();
6262
}
6363
}

0 commit comments

Comments
 (0)