admin = UserFactory::withTokens()->asAdmin()->create(); } public function test_list(): void { $response = $this->actingAs($this->admin)->getJson(self::URI); $response->assertOk(); $response->assertJson(Role::all()->toArray()); } public function test_unauthorized(): void { $response = $this->getJson(self::URI); $response->assertUnauthorized(); } }