File tree Expand file tree Collapse file tree
Open diff view settings
Expand file tree Collapse file tree
Open diff view settings
Original file line number Diff line number Diff line change 2121use Doctrine \ORM \Proxy \Autoloader ;
2222use Doctrine \ORM \Tools \Console \Command \ConvertMappingCommand ;
2323use Doctrine \ORM \Tools \Console \Command \EnsureProductionSettingsCommand ;
24+ use Doctrine \ORM \Tools \Export \ClassMetadataExporter ;
2425use Doctrine \ORM \UnitOfWork ;
2526use LogicException ;
2627use Symfony \Bridge \Doctrine \DependencyInjection \AbstractDoctrineExtension ;
@@ -471,6 +472,10 @@ protected function ormLoad(array $config, ContainerBuilder $container)
471472 $ container ->removeDefinition ('doctrine.ensure_production_settings_command ' );
472473 }
473474
475+ if (! class_exists (ClassMetadataExporter::class)) {
476+ $ container ->removeDefinition ('doctrine.mapping_import_command ' );
477+ }
478+
474479 $ entityManagers = [];
475480 foreach (array_keys ($ config ['entity_managers ' ]) as $ name ) {
476481 $ entityManagers [$ name ] = sprintf ('doctrine.orm.%s_entity_manager ' , $ name );
Original file line number Diff line number Diff line change 44
55use Doctrine \Bundle \DoctrineBundle \Tests \DependencyInjection \Fixtures \TestKernel ;
66use Doctrine \ORM \EntityManagerInterface ;
7+ use Doctrine \ORM \Tools \Export \ClassMetadataExporter ;
78use InvalidArgumentException ;
89use PHPUnit \Framework \TestCase ;
910use Symfony \Bundle \FrameworkBundle \Console \Application ;
1011use Symfony \Component \Console \Tester \CommandTester ;
1112use Symfony \Component \Filesystem \Filesystem ;
1213use Symfony \Component \HttpKernel \Bundle \Bundle ;
1314
15+ use function class_exists ;
1416use function file_get_contents ;
1517use function interface_exists ;
1618use function sys_get_temp_dir ;
@@ -26,11 +28,11 @@ class ImportMappingDoctrineCommandTest extends TestCase
2628
2729 public static function setUpBeforeClass (): void
2830 {
29- if (interface_exists (EntityManagerInterface::class)) {
31+ if (interface_exists (EntityManagerInterface::class) && class_exists (ClassMetadataExporter::class) ) {
3032 return ;
3133 }
3234
33- self ::markTestSkipped ('This test requires ORM ' );
35+ self ::markTestSkipped ('This test requires ORM version 2 ' );
3436 }
3537
3638 protected function setup (): void
You can’t perform that action at this time.
0 commit comments