@@ 487-502 (lines=16) @@ | ||
484 | $this->assertEquals('YamlBundle\Cache\MyCacheFactory', $slcDefinition->getClass()); |
|
485 | } |
|
486 | ||
487 | public function testBundleEntityAliases() |
|
488 | { |
|
489 | $container = $this->getContainer(); |
|
490 | $extension = new DoctrineExtension(); |
|
491 | ||
492 | $config = BundleConfigurationBuilder::createBuilder() |
|
493 | ->addBaseConnection() |
|
494 | ->build(); |
|
495 | $config['orm'] = ['default_entity_manager' => 'default', 'entity_managers' => ['default' => ['mappings' => ['YamlBundle' => []]]]]; |
|
496 | $extension->load([$config], $container); |
|
497 | ||
498 | $definition = $container->getDefinition('doctrine.orm.default_configuration'); |
|
499 | $this->assertDICDefinitionMethodCallOnce( |
|
500 | $definition, |
|
501 | 'setEntityNamespaces', |
|
502 | [['YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity']] |
|
503 | ); |
|
504 | } |
|
505 | ||
@@ 506-521 (lines=16) @@ | ||
503 | ); |
|
504 | } |
|
505 | ||
506 | public function testOverwriteEntityAliases() |
|
507 | { |
|
508 | $container = $this->getContainer(); |
|
509 | $extension = new DoctrineExtension(); |
|
510 | ||
511 | $config = BundleConfigurationBuilder::createBuilder() |
|
512 | ->addBaseConnection() |
|
513 | ->build(); |
|
514 | $config['orm'] = ['default_entity_manager' => 'default', 'entity_managers' => ['default' => ['mappings' => ['YamlBundle' => ['alias' => 'yml']]]]]; |
|
515 | $extension->load([$config], $container); |
|
516 | ||
517 | $definition = $container->getDefinition('doctrine.orm.default_configuration'); |
|
518 | $this->assertDICDefinitionMethodCallOnce( |
|
519 | $definition, |
|
520 | 'setEntityNamespaces', |
|
521 | [['yml' => 'Fixtures\Bundles\YamlBundle\Entity']] |
|
522 | ); |
|
523 | } |
|
524 | ||
@@ 543-568 (lines=26) @@ | ||
540 | ]); |
|
541 | } |
|
542 | ||
543 | public function testXmlBundleMappingDetection() |
|
544 | { |
|
545 | $container = $this->getContainer('XmlBundle'); |
|
546 | $extension = new DoctrineExtension(); |
|
547 | ||
548 | $config = BundleConfigurationBuilder::createBuilder() |
|
549 | ->addBaseConnection() |
|
550 | ->addEntityManager([ |
|
551 | 'default_entity_manager' => 'default', |
|
552 | 'entity_managers' => [ |
|
553 | 'default' => [ |
|
554 | 'mappings' => [ |
|
555 | 'XmlBundle' => [], |
|
556 | ], |
|
557 | ], |
|
558 | ], |
|
559 | ]) |
|
560 | ->build(); |
|
561 | $extension->load([$config], $container); |
|
562 | ||
563 | $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); |
|
564 | $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', [ |
|
565 | new Reference('doctrine.orm.default_xml_metadata_driver'), |
|
566 | 'Fixtures\Bundles\XmlBundle\Entity', |
|
567 | ]); |
|
568 | } |
|
569 | ||
570 | public function testAnnotationsBundleMappingDetection() |
|
571 | { |
|
@@ 570-595 (lines=26) @@ | ||
567 | ]); |
|
568 | } |
|
569 | ||
570 | public function testAnnotationsBundleMappingDetection() |
|
571 | { |
|
572 | $container = $this->getContainer('AnnotationsBundle'); |
|
573 | $extension = new DoctrineExtension(); |
|
574 | ||
575 | $config = BundleConfigurationBuilder::createBuilder() |
|
576 | ->addBaseConnection() |
|
577 | ->addEntityManager([ |
|
578 | 'default_entity_manager' => 'default', |
|
579 | 'entity_managers' => [ |
|
580 | 'default' => [ |
|
581 | 'mappings' => [ |
|
582 | 'AnnotationsBundle' => [], |
|
583 | ], |
|
584 | ], |
|
585 | ], |
|
586 | ]) |
|
587 | ->build(); |
|
588 | $extension->load([$config], $container); |
|
589 | ||
590 | $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); |
|
591 | $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', [ |
|
592 | new Reference('doctrine.orm.default_annotation_metadata_driver'), |
|
593 | 'Fixtures\Bundles\AnnotationsBundle\Entity', |
|
594 | ]); |
|
595 | } |
|
596 | ||
597 | public function testOrmMergeConfigs() |
|
598 | { |