Skip to content

Commit

Permalink
Fix a remaining test for PropertyInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Nov 15, 2018
1 parent 90595ae commit 07be011
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/DoctrineExtension.php
Expand Up @@ -801,7 +801,7 @@ protected function loadOrmCacheDrivers(array $entityManager, ContainerBuilder $c
private function loadPropertyInfoExtractor($entityManagerName, ContainerBuilder $container)
{
$propertyExtractorDefinition = $container->register(sprintf('doctrine.orm.%s_entity_manager.property_info_extractor', $entityManagerName), DoctrineExtractor::class);
if (class_exists(PropertyInitializableExtractorInterface::class)) {
if (interface_exists(PropertyInitializableExtractorInterface::class)) {
$argumentId = sprintf('doctrine.orm.%s_entity_manager', $entityManagerName);
} else {
$argumentId = sprintf('doctrine.orm.%s_entity_manager.metadata_factory', $entityManagerName);
Expand Down
5 changes: 4 additions & 1 deletion Tests/ContainerTest.php
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\Bundle\DoctrineBundle\Tests;

use Doctrine\DBAL\Types\Type;
use Symfony\Component\PropertyInfo\PropertyInitializableExtractorInterface;

class ContainerTest extends TestCase
{
Expand Down Expand Up @@ -48,7 +49,9 @@ public function testContainer()
$this->assertFalse($container->has('doctrine.dbal.default_connection.events.mysqlsessioninit'));

if (interface_exists('Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface') && class_exists('Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor')) {
$this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory', $container->get('doctrine.orm.default_entity_manager.metadata_factory'));
if (!interface_exists(PropertyInitializableExtractorInterface::class)) {
$this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory', $container->get('doctrine.orm.default_entity_manager.metadata_factory'));
}
$this->assertInstanceOf('Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor', $container->get('doctrine.orm.default_entity_manager.property_info_extractor'));
} else {
$this->assertFalse($container->has('doctrine.orm.default_entity_manager.metadata_factory'));
Expand Down

0 comments on commit 07be011

Please sign in to comment.