<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\CmsBundle\Tests\Twig\Extension;

use Contao\CoreBundle\Csrf\ContaoCsrfTokenManager;
use Ferienpass\CmsBundle\Twig\Extension\RequestTokenExtension;
use PHPUnit\Framework\TestCase;

final class RequestTokenExtensionTest extends TestCase
{
    public function testRequestTokenDelegatesToTokenManager(): void
    {
        $manager = $this->createMock(ContaoCsrfTokenManager::class);
        $manager->method('getDefaultTokenValue')->willReturn('csrf_token_value_123');

        $extension = new RequestTokenExtension($manager);

        self::assertSame('csrf_token_value_123', $extension->requestToken());
    }
}
