<?php

namespace Tests\Unit\Resources\Roles;

use App\Http\Resources\Roles\PermissionResource;
use Tests\TestCase;

class PermissionResourceTest extends TestCase
{
    public function test_resource_shape(): void
    {
        $resource = new PermissionResource([
            'id' => 1,
            'name' => 'manage_roles',
            'description' => 'Manage roles',
        ]);

        $payload = $resource->toArray(request());

        $this->assertArrayHasKey('id', $payload);
        $this->assertArrayHasKey('name', $payload);
        $this->assertArrayHasKey('description', $payload);
    }
}
