<?php

declare(strict_types=1);

namespace Ferienpass\AdminBundle\Tests\Controller\Page;

use Ferienpass\AdminBundle\Controller\Page\RegistrationController;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Routing\Attribute\Route;

final class RegistrationControllerTest extends TestCase
{
    public function testRouteConfiguration(): void
    {
        $ref = new \ReflectionClass(RegistrationController::class);
        $attrs = $ref->getAttributes(Route::class);

        self::assertCount(1, $attrs);
        $route = $attrs[0]->newInstance();
        self::assertSame('/registrierung', $route->getPath());
        self::assertSame('admin_registration', $route->getName());
    }

    public function testControllerIsFinal(): void
    {
        $ref = new \ReflectionClass(RegistrationController::class);
        self::assertTrue($ref->isFinal());
    }

    public function testControllerExtendsAbstractController(): void
    {
        $ref = new \ReflectionClass(RegistrationController::class);
        self::assertTrue($ref->isSubclassOf(\Symfony\Bundle\FrameworkBundle\Controller\AbstractController::class));
    }
}
