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