Skip to content

Commit 8345ea5

Browse files
committed
Fixes time usage in test
1 parent 419a9bf commit 8345ea5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/Feature/Recorders/UserRequestsTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Illuminate\Auth\GuardHelpers;
44
use Illuminate\Contracts\Auth\Guard;
5+
use Illuminate\Support\Carbon;
56
use Illuminate\Support\Facades\Auth;
67
use Illuminate\Support\Facades\Config;
78
use Illuminate\Support\Facades\DB;
@@ -15,14 +16,15 @@
1516
use function Pest\Laravel\post;
1617

1718
it('captures authenticated requests', function () {
19+
Carbon::setTestNow('2000-01-02 03:04:05');
1820
Route::get('users', fn () => []);
1921

2022
actingAs(User::make(['id' => '567']))->get('users');
2123

2224
$entries = Pulse::ignore(fn () => DB::table('pulse_entries')->get());
2325
expect($entries)->toHaveCount(1);
2426
expect($entries[0])->toHaveProperties([
25-
'timestamp' => now()->timestamp,
27+
'timestamp' => 946782245,
2628
'type' => 'user_request',
2729
'key' => '567',
2830
'value' => null,

0 commit comments

Comments
 (0)