getJson(route('permissions.index')); $response->assertUnauthorized(); } public function test_all_permissions_returned_successfully(): void { $user = User::factory() ->create(); $response = $this->actingAs($user)->getJson(route('permissions.index')); $response->assertOk(); $response->assertJsonStructure([ 'data' => [ '*' => [ 'id', 'name', 'name_fa', 'guard_name', 'created_at', 'updated_at', ], ] ]); } }