<?php

declare(strict_types=1);

namespace Ferienpass\AdminBundle\Tests\Event;

use Ferienpass\AdminBundle\Event\ParticipantListEvent;
use Ferienpass\CoreBundle\Entity\Offer\OfferInterface;
use PHPUnit\Framework\TestCase;

final class ParticipantListEventTest extends TestCase
{
    public function testGetOfferReturnsOffer(): void
    {
        $offer = $this->createStub(OfferInterface::class);
        $event = new ParticipantListEvent($offer, ['col1', 'col2']);

        self::assertSame($offer, $event->getOffer());
    }

    public function testGetColumnsReturnsInitialColumns(): void
    {
        $offer = $this->createStub(OfferInterface::class);
        $event = new ParticipantListEvent($offer, ['col1', 'col2']);

        self::assertSame(['col1', 'col2'], $event->getColumns());
    }

    public function testSetColumnsUpdatesColumns(): void
    {
        $offer = $this->createStub(OfferInterface::class);
        $event = new ParticipantListEvent($offer, ['col1']);
        $event->setColumns(['col2', 'col3']);

        self::assertSame(['col2', 'col3'], $event->getColumns());
    }
}
