@@ 463-478 (lines=16) @@ | ||
460 | $this->assertEquals('YamlBundle\Cache\MyCacheFactory', $slcDefinition->getClass()); |
|
461 | } |
|
462 | ||
463 | public function testBundleEntityAliases() |
|
464 | { |
|
465 | $container = $this->getContainer(); |
|
466 | $extension = new DoctrineExtension(); |
|
467 | ||
468 | $config = BundleConfigurationBuilder::createBuilder() |
|
469 | ->addBaseConnection() |
|
470 | ->build(); |
|
471 | $config['orm'] = ['default_entity_manager' => 'default', 'entity_managers' => ['default' => ['mappings' => ['YamlBundle' => []]]]]; |
|
472 | $extension->load([$config], $container); |
|
473 | ||
474 | $definition = $container->getDefinition('doctrine.orm.default_configuration'); |
|
475 | $this->assertDICDefinitionMethodCallOnce( |
|
476 | $definition, |
|
477 | 'setEntityNamespaces', |
|
478 | [['YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity']] |
|
479 | ); |
|
480 | } |
|
481 | ||
@@ 482-497 (lines=16) @@ | ||
479 | ); |
|
480 | } |
|
481 | ||
482 | public function testOverwriteEntityAliases() |
|
483 | { |
|
484 | $container = $this->getContainer(); |
|
485 | $extension = new DoctrineExtension(); |
|
486 | ||
487 | $config = BundleConfigurationBuilder::createBuilder() |
|
488 | ->addBaseConnection() |
|
489 | ->build(); |
|
490 | $config['orm'] = ['default_entity_manager' => 'default', 'entity_managers' => ['default' => ['mappings' => ['YamlBundle' => ['alias' => 'yml']]]]]; |
|
491 | $extension->load([$config], $container); |
|
492 | ||
493 | $definition = $container->getDefinition('doctrine.orm.default_configuration'); |
|
494 | $this->assertDICDefinitionMethodCallOnce( |
|
495 | $definition, |
|
496 | 'setEntityNamespaces', |
|
497 | [['yml' => 'Fixtures\Bundles\YamlBundle\Entity']] |
|
498 | ); |
|
499 | } |
|
500 | ||
@@ 519-544 (lines=26) @@ | ||
516 | ]); |
|
517 | } |
|
518 | ||
519 | public function testXmlBundleMappingDetection() |
|
520 | { |
|
521 | $container = $this->getContainer('XmlBundle'); |
|
522 | $extension = new DoctrineExtension(); |
|
523 | ||
524 | $config = BundleConfigurationBuilder::createBuilder() |
|
525 | ->addBaseConnection() |
|
526 | ->addEntityManager([ |
|
527 | 'default_entity_manager' => 'default', |
|
528 | 'entity_managers' => [ |
|
529 | 'default' => [ |
|
530 | 'mappings' => [ |
|
531 | 'XmlBundle' => [], |
|
532 | ], |
|
533 | ], |
|
534 | ], |
|
535 | ]) |
|
536 | ->build(); |
|
537 | $extension->load([$config], $container); |
|
538 | ||
539 | $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); |
|
540 | $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', [ |
|
541 | new Reference('doctrine.orm.default_xml_metadata_driver'), |
|
542 | 'Fixtures\Bundles\XmlBundle\Entity', |
|
543 | ]); |
|
544 | } |
|
545 | ||
546 | public function testAnnotationsBundleMappingDetection() |
|
547 | { |
|
@@ 546-571 (lines=26) @@ | ||
543 | ]); |
|
544 | } |
|
545 | ||
546 | public function testAnnotationsBundleMappingDetection() |
|
547 | { |
|
548 | $container = $this->getContainer('AnnotationsBundle'); |
|
549 | $extension = new DoctrineExtension(); |
|
550 | ||
551 | $config = BundleConfigurationBuilder::createBuilder() |
|
552 | ->addBaseConnection() |
|
553 | ->addEntityManager([ |
|
554 | 'default_entity_manager' => 'default', |
|
555 | 'entity_managers' => [ |
|
556 | 'default' => [ |
|
557 | 'mappings' => [ |
|
558 | 'AnnotationsBundle' => [], |
|
559 | ], |
|
560 | ], |
|
561 | ], |
|
562 | ]) |
|
563 | ->build(); |
|
564 | $extension->load([$config], $container); |
|
565 | ||
566 | $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); |
|
567 | $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', [ |
|
568 | new Reference('doctrine.orm.default_annotation_metadata_driver'), |
|
569 | 'Fixtures\Bundles\AnnotationsBundle\Entity', |
|
570 | ]); |
|
571 | } |
|
572 | ||
573 | public function testOrmMergeConfigs() |
|
574 | { |