<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Tests\Controller;

use CpCreation\VitiCore\Bridge\Symfony\Bundle\Controller\Site\ProductReviewReportController;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Yaml\Yaml;

final class ProductReviewReportControllerTest extends TestCase
{
    public function testPublicRouteSupportsTheCsrfProtectedFormFlow(): void
    {
        $routes = Yaml::parseFile(__DIR__ . '/../../src/Bridge/Symfony/Bundle/Resources/config/routes/site_shop.yaml');
        $route = $routes['shop_product_review_report'];

        self::assertSame(ProductReviewReportController::class . '::report', $route['controller']);
        self::assertSame(['GET', 'POST'], $route['methods']);
        self::assertSame('[0-9a-fA-F-]{36}', $route['requirements']['id']);
    }
}
