@@ 453-468 (lines=16) @@ | ||
450 | $this->assertEquals('YamlBundle\Cache\MyCacheFactory', $slcDefinition->getClass()); |
|
451 | } |
|
452 | ||
453 | public function testBundleEntityAliases() |
|
454 | { |
|
455 | $container = $this->getContainer(); |
|
456 | $extension = new DoctrineExtension(); |
|
457 | ||
458 | $config = BundleConfigurationBuilder::createBuilder() |
|
459 | ->addBaseConnection() |
|
460 | ->build(); |
|
461 | $config['orm'] = ['default_entity_manager' => 'default', 'entity_managers' => ['default' => ['mappings' => ['YamlBundle' => []]]]]; |
|
462 | $extension->load([$config], $container); |
|
463 | ||
464 | $definition = $container->getDefinition('doctrine.orm.default_configuration'); |
|
465 | $this->assertDICDefinitionMethodCallOnce( |
|
466 | $definition, |
|
467 | 'setEntityNamespaces', |
|
468 | [['YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity']] |
|
469 | ); |
|
470 | } |
|
471 | ||
@@ 472-487 (lines=16) @@ | ||
469 | ); |
|
470 | } |
|
471 | ||
472 | public function testOverwriteEntityAliases() |
|
473 | { |
|
474 | $container = $this->getContainer(); |
|
475 | $extension = new DoctrineExtension(); |
|
476 | ||
477 | $config = BundleConfigurationBuilder::createBuilder() |
|
478 | ->addBaseConnection() |
|
479 | ->build(); |
|
480 | $config['orm'] = ['default_entity_manager' => 'default', 'entity_managers' => ['default' => ['mappings' => ['YamlBundle' => ['alias' => 'yml']]]]]; |
|
481 | $extension->load([$config], $container); |
|
482 | ||
483 | $definition = $container->getDefinition('doctrine.orm.default_configuration'); |
|
484 | $this->assertDICDefinitionMethodCallOnce( |
|
485 | $definition, |
|
486 | 'setEntityNamespaces', |
|
487 | [['yml' => 'Fixtures\Bundles\YamlBundle\Entity']] |
|
488 | ); |
|
489 | } |
|
490 | ||
@@ 509-534 (lines=26) @@ | ||
506 | ]); |
|
507 | } |
|
508 | ||
509 | public function testXmlBundleMappingDetection() |
|
510 | { |
|
511 | $container = $this->getContainer('XmlBundle'); |
|
512 | $extension = new DoctrineExtension(); |
|
513 | ||
514 | $config = BundleConfigurationBuilder::createBuilder() |
|
515 | ->addBaseConnection() |
|
516 | ->addEntityManager([ |
|
517 | 'default_entity_manager' => 'default', |
|
518 | 'entity_managers' => [ |
|
519 | 'default' => [ |
|
520 | 'mappings' => [ |
|
521 | 'XmlBundle' => [], |
|
522 | ], |
|
523 | ], |
|
524 | ], |
|
525 | ]) |
|
526 | ->build(); |
|
527 | $extension->load([$config], $container); |
|
528 | ||
529 | $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); |
|
530 | $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', [ |
|
531 | new Reference('doctrine.orm.default_xml_metadata_driver'), |
|
532 | 'Fixtures\Bundles\XmlBundle\Entity', |
|
533 | ]); |
|
534 | } |
|
535 | ||
536 | public function testAnnotationsBundleMappingDetection() |
|
537 | { |
|
@@ 536-561 (lines=26) @@ | ||
533 | ]); |
|
534 | } |
|
535 | ||
536 | public function testAnnotationsBundleMappingDetection() |
|
537 | { |
|
538 | $container = $this->getContainer('AnnotationsBundle'); |
|
539 | $extension = new DoctrineExtension(); |
|
540 | ||
541 | $config = BundleConfigurationBuilder::createBuilder() |
|
542 | ->addBaseConnection() |
|
543 | ->addEntityManager([ |
|
544 | 'default_entity_manager' => 'default', |
|
545 | 'entity_managers' => [ |
|
546 | 'default' => [ |
|
547 | 'mappings' => [ |
|
548 | 'AnnotationsBundle' => [], |
|
549 | ], |
|
550 | ], |
|
551 | ], |
|
552 | ]) |
|
553 | ->build(); |
|
554 | $extension->load([$config], $container); |
|
555 | ||
556 | $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); |
|
557 | $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', [ |
|
558 | new Reference('doctrine.orm.default_annotation_metadata_driver'), |
|
559 | 'Fixtures\Bundles\AnnotationsBundle\Entity', |
|
560 | ]); |
|
561 | } |
|
562 | ||
563 | public function testOrmMergeConfigs() |
|
564 | { |