Skip to content

Commit

Permalink
Fixes time usage in test
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Jul 25, 2024
1 parent 419a9bf commit 8345ea5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Feature/Recorders/UserRequestsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Illuminate\Auth\GuardHelpers;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
Expand All @@ -15,14 +16,15 @@
use function Pest\Laravel\post;

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

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

$entries = Pulse::ignore(fn () => DB::table('pulse_entries')->get());
expect($entries)->toHaveCount(1);
expect($entries[0])->toHaveProperties([
'timestamp' => now()->timestamp,
'timestamp' => 946782245,
'type' => 'user_request',
'key' => '567',
'value' => null,
Expand Down

0 comments on commit 8345ea5

Please sign in to comment.