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