<?php

namespace App\Tests\Application\Public;

use App\Entity\Public\FederationStructure;
use App\Tests\Application\OtWebTestCase;

class PublicStructuresTest extends OtWebTestCase
{
    public function testGetIndex(): void
    {
        $crawler = $this->get('api/public/federation_structures');

        $this->validateCollectionSchema(FederationStructure::class);

        $this->assertJsonContains([
            '@context' => '/api/contexts/FederationStructure',
            '@id' => '/api/public/federation_structures',
            '@type' => 'hydra:Collection',
            'hydra:totalItems' => 2,
            'hydra:member' => [
                ["name" => "Fede 1"],
                ["name" => "Organization 2"],
            ],
        ]);
    }
}
