<?php

declare(strict_types=1);

namespace Ferienpass\AdminBundle\Tests\LiveComponent;

use Doctrine\ORM\QueryBuilder;
use Ferienpass\AdminBundle\LiveComponent\QueryBuilderHydrationExtension;
use PHPUnit\Framework\TestCase;
use Doctrine\Persistence\ManagerRegistry;

final class QueryBuilderHydrationExtensionTest extends TestCase
{
    public function testSupportsQueryBuilder(): void
    {
        $registry = $this->createMock(ManagerRegistry::class);
        $ext = new QueryBuilderHydrationExtension($registry);

        self::assertTrue($ext->supports(QueryBuilder::class));
    }

    public function testDoesNotSupportOtherClasses(): void
    {
        $registry = $this->createMock(ManagerRegistry::class);
        $ext = new QueryBuilderHydrationExtension($registry);

        self::assertFalse($ext->supports(\stdClass::class));
    }
}
