diff --git a/Tests/PropertyInfo/DoctrineExtractorTest.php b/Tests/PropertyInfo/DoctrineExtractorTest.php index 729adf85..42a8d656 100644 --- a/Tests/PropertyInfo/DoctrineExtractorTest.php +++ b/Tests/PropertyInfo/DoctrineExtractorTest.php @@ -15,6 +15,7 @@ use Doctrine\DBAL\Types\Type as DBALType; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Mapping\Column; +use Doctrine\ORM\ORMSetup; use Doctrine\ORM\Tools\Setup; use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor; @@ -33,7 +34,9 @@ class DoctrineExtractorTest extends TestCase { private function createExtractor() { - $config = Setup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true); + $config = class_exists(ORMSetup::class) + ? ORMSetup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true) + : Setup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true); $entityManager = EntityManager::create(['driver' => 'pdo_sqlite'], $config); if (!DBALType::hasType('foo')) { diff --git a/composer.json b/composer.json index 68641976..3be37e0b 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "symfony/validator": "^5.4|^6.0", "symfony/translation": "^5.4|^6.0", "symfony/var-dumper": "^5.4|^6.0", - "doctrine/annotations": "^1.10.4", + "doctrine/annotations": "^1.10.4|^2", "doctrine/collections": "^1.0|^2.0", "doctrine/data-fixtures": "^1.1", "doctrine/dbal": "^2.13.1|^3.0",