<?php

declare(strict_types=1);

namespace Ferienpass\AdminBundle\Tests\WorkflowSurvey;

use Ferienpass\AdminBundle\WorkflowSurvey\AbstractOfferCompleteSurvey;
use PHPUnit\Framework\TestCase;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class AbstractOfferCompleteSurveyTest extends TestCase
{
    public function testConfigureOptionsSetLabelFormatAndTranslationDomain(): void
    {
        $survey = new class extends AbstractOfferCompleteSurvey {
            public static function getName(): string
            {
                return 'my_survey';
            }
        };

        $resolver = new OptionsResolver();
        // Need to call the parent AbstractType's configureOptions first to initialize standard options
        $survey->configureOptions($resolver);

        $resolved = $resolver->resolve([]);
        self::assertSame('admin', $resolved['translation_domain']);
        self::assertStringContainsString('surveys.', $resolved['label_format']);
        self::assertStringContainsString('%name%', $resolved['label_format']);
    }
}
