<?php

namespace Tests\Unit\Resources\Roles;

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

class RolePermissionResourceTest extends TestCase
{
    public function test_resource_shape(): void
    {
        $resource = new RolePermissionResource([
            'id' => 1,
            'name' => 'manage_roles',
            'can_create' => 1,
            'can_read' => 0,
        ]);

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

        $this->assertArrayHasKey('permission_id', $payload);
        $this->assertArrayHasKey('can_create', $payload);
        $this->assertArrayHasKey('can_read', $payload);
    }
}
