@@ 464-477 (lines=14) @@ | ||
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 = $this->getConnectionConfig(); |
|
470 | $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))); |
|
471 | $extension->load(array($config), $container); |
|
472 | ||
473 | $definition = $container->getDefinition('doctrine.orm.default_configuration'); |
|
474 | $this->assertDICDefinitionMethodCallOnce($definition, 'setEntityNamespaces', |
|
475 | array(array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\Entity')) |
|
476 | ); |
|
477 | } |
|
478 | ||
479 | public function testOverwriteEntityAliases() |
|
480 | { |
|
@@ 479-492 (lines=14) @@ | ||
476 | ); |
|
477 | } |
|
478 | ||
479 | public function testOverwriteEntityAliases() |
|
480 | { |
|
481 | $container = $this->getContainer(); |
|
482 | $extension = new DoctrineExtension(); |
|
483 | ||
484 | $config = $this->getConnectionConfig(); |
|
485 | $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array('alias' => 'yml'))))); |
|
486 | $extension->load(array($config), $container); |
|
487 | ||
488 | $definition = $container->getDefinition('doctrine.orm.default_configuration'); |
|
489 | $this->assertDICDefinitionMethodCallOnce($definition, 'setEntityNamespaces', |
|
490 | array(array('yml' => 'Fixtures\Bundles\YamlBundle\Entity')) |
|
491 | ); |
|
492 | } |
|
493 | ||
494 | public function testYamlBundleMappingDetection() |
|
495 | { |
|
@@ 494-508 (lines=15) @@ | ||
491 | ); |
|
492 | } |
|
493 | ||
494 | public function testYamlBundleMappingDetection() |
|
495 | { |
|
496 | $container = $this->getContainer('YamlBundle'); |
|
497 | $extension = new DoctrineExtension(); |
|
498 | ||
499 | $config = $this->getConnectionConfig(); |
|
500 | $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('YamlBundle' => array())))); |
|
501 | $extension->load(array($config), $container); |
|
502 | ||
503 | $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); |
|
504 | $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', array( |
|
505 | new Reference('doctrine.orm.default_yml_metadata_driver'), |
|
506 | 'Fixtures\Bundles\YamlBundle\Entity', |
|
507 | )); |
|
508 | } |
|
509 | ||
510 | public function testXmlBundleMappingDetection() |
|
511 | { |
|
@@ 510-524 (lines=15) @@ | ||
507 | )); |
|
508 | } |
|
509 | ||
510 | public function testXmlBundleMappingDetection() |
|
511 | { |
|
512 | $container = $this->getContainer('XmlBundle'); |
|
513 | $extension = new DoctrineExtension(); |
|
514 | ||
515 | $config = $this->getConnectionConfig(); |
|
516 | $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('XmlBundle' => array())))); |
|
517 | $extension->load(array($config), $container); |
|
518 | ||
519 | $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); |
|
520 | $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', array( |
|
521 | new Reference('doctrine.orm.default_xml_metadata_driver'), |
|
522 | 'Fixtures\Bundles\XmlBundle\Entity', |
|
523 | )); |
|
524 | } |
|
525 | ||
526 | public function testAnnotationsBundleMappingDetection() |
|
527 | { |
|
@@ 526-540 (lines=15) @@ | ||
523 | )); |
|
524 | } |
|
525 | ||
526 | public function testAnnotationsBundleMappingDetection() |
|
527 | { |
|
528 | $container = $this->getContainer('AnnotationsBundle'); |
|
529 | $extension = new DoctrineExtension(); |
|
530 | ||
531 | $config = $this->getConnectionConfig(); |
|
532 | $config['orm'] = array('default_entity_manager' => 'default', 'entity_managers' => array('default' => array('mappings' => array('AnnotationsBundle' => array())))); |
|
533 | $extension->load(array($config), $container); |
|
534 | ||
535 | $definition = $container->getDefinition('doctrine.orm.default_metadata_driver'); |
|
536 | $this->assertDICDefinitionMethodCallOnce($definition, 'addDriver', array( |
|
537 | new Reference('doctrine.orm.default_annotation_metadata_driver'), |
|
538 | 'Fixtures\Bundles\AnnotationsBundle\Entity', |
|
539 | )); |
|
540 | } |
|
541 | ||
542 | public function testOrmMergeConfigs() |
|
543 | { |