<?php

namespace App\Tests\Application\Public;
use App\Entity\Public\PublicEvent;
use App\Tests\Application\OtWebTestCase;

class PublicEventsTest extends OtWebTestCase
{

    public function testEvents(): void
    {
        $this->get('/api/public/events');

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

        $this->assertJsonContains([
            '@context' => '/api/contexts/PublicEvent',
            '@id' => '/api/public/events',
            '@type' => 'hydra:Collection',
            'hydra:totalItems' => 1,
            'hydra:member' => [
                ["name" => "My Event"]
            ],
        ]);
    }
}
