|
17 | 17 | use Doctrine\ORM\Configuration as OrmConfiguration;
|
18 | 18 | use Doctrine\ORM\EntityManager;
|
19 | 19 | use Doctrine\ORM\EntityManagerInterface;
|
| 20 | +use Doctrine\ORM\Mapping\Driver\AnnotationDriver; |
20 | 21 | use Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver;
|
21 | 22 | use Doctrine\ORM\Proxy\ProxyFactory;
|
22 | 23 | use Generator;
|
|
28 | 29 | use Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestHydrator;
|
29 | 30 | use Symfony\Component\Cache\Adapter\ArrayAdapter;
|
30 | 31 | use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
|
| 32 | +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; |
31 | 33 | use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
32 | 34 | use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass;
|
33 | 35 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
@@ -568,7 +570,7 @@ public function testSingleEntityManagerMultipleMappingBundleDefinitions(): void
|
568 | 570 | __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'Bundles' . DIRECTORY_SEPARATOR . 'AttributesBundle' . DIRECTORY_SEPARATOR . 'Entity',
|
569 | 571 | ],
|
570 | 572 | ),
|
571 |
| - false, |
| 573 | + ! class_exists(AnnotationDriver::class), |
572 | 574 | ]);
|
573 | 575 |
|
574 | 576 | $ymlDef = $container->getDefinition('doctrine.orm.default_yml_metadata_driver');
|
@@ -627,7 +629,7 @@ public function testMultipleEntityManagersMappingBundleDefinitions(): void
|
627 | 629 | [
|
628 | 630 | __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'Bundles' . DIRECTORY_SEPARATOR . 'AnnotationsBundle' . DIRECTORY_SEPARATOR . 'Entity',
|
629 | 631 | ],
|
630 |
| - false, |
| 632 | + ! class_exists(AnnotationDriver::class), |
631 | 633 | ]);
|
632 | 634 | }
|
633 | 635 |
|
@@ -972,6 +974,21 @@ public function testDisablingLazyGhostOnOrm3Throws(): void
|
972 | 974 | $this->loadContainer('orm_no_lazy_ghost');
|
973 | 975 | }
|
974 | 976 |
|
| 977 | + public function testDisablingReportFieldsWhereDeclaredOnOrm3Throws(): void |
| 978 | + { |
| 979 | + if (! interface_exists(EntityManagerInterface::class)) { |
| 980 | + self::markTestSkipped('This test requires ORM'); |
| 981 | + } |
| 982 | + |
| 983 | + if (class_exists(AnnotationDriver::class)) { |
| 984 | + self::markTestSkipped('This test requires ORM 3.'); |
| 985 | + } |
| 986 | + |
| 987 | + $this->expectException(InvalidConfigurationException::class); |
| 988 | + $this->expectExceptionMessage('Invalid configuration for path "doctrine.orm.entity_managers.default.report_fields_where_declared": The setting "report_fields_where_declared" cannot be disabled for ORM 3.'); |
| 989 | + $this->loadContainer('orm_no_report_fields'); |
| 990 | + } |
| 991 | + |
975 | 992 | public function testResolveTargetEntity(): void
|
976 | 993 | {
|
977 | 994 | if (! interface_exists(EntityManagerInterface::class)) {
|
|
0 commit comments