Skip to content

Commit

Permalink
Add test covering instances with Doctrine metadata disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
CRC-Mismatch committed Dec 14, 2023
1 parent 78a7e7f commit c358619
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Tests/DependencyInjection/DoctrinePassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,30 @@ public function testDoctrineDisabled()
$this->assertFalse(self::assertDefinitionIsOfType($container, $driver, 'JMS\Serializer\Metadata\Driver\DoctrinePHPCRTypeDriver'));
}

public function testDoctrineDisabledOnlyForInstance()
{
$container = $this->getContainer([
'instances' => [
'my_instance' => [
'inherit' => true,
'metadata' => ['infer_types_from_doctrine_metadata' => false],
],
],
]);
$container->register('doctrine.orm.entity_manager', 'stdClass');
$container->register('doctrine', 'stdClass');
$container->register('doctrine_phpcr.odm.document_manager', 'stdClass');
$container->register('doctrine_phpcr', 'stdClass');

$container->compile();

$driver = $container->findDefinition('jms_serializer.instance.my_instance.metadata_driver');

$this->assertFalse(self::assertDefinitionIsOfType($container, $driver, 'JMS\Serializer\Metadata\Driver\DoctrineTypeDriver'));

$this->assertFalse(self::assertDefinitionIsOfType($container, $driver, 'JMS\Serializer\Metadata\Driver\DoctrinePHPCRTypeDriver'));
}

public function testOrm()
{
$container = $this->getContainer();
Expand Down

0 comments on commit c358619

Please sign in to comment.