user = UserFactory::withTokens()->create(); } public function test_me(): void { $response = $this->actingAs($this->user)->getJson(self::URI); $response->assertOk(); $response->assertJson(['user' => $this->user->toArray()]); } public function test_without_auth(): void { $response = $this->getJson(self::URI); $response->assertUnauthorized(); } }