1
0
mirror of synced 2025-01-19 15:01:40 +03:00

DDC-3427 - Adding a test to verify that the ClassMetadataFactory supports setting an EntityManagerInterface instance

This commit is contained in:
Marco Pivetta 2014-12-05 13:38:45 +01:00
parent b9506ac64a
commit d20e018081

View File

@ -321,6 +321,22 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase
$this->assertEquals('group-id', $groups['joinTable']['inverseJoinColumns'][0]['name']); $this->assertEquals('group-id', $groups['joinTable']['inverseJoinColumns'][0]['name']);
$this->assertEquals('group-id', $groups['joinTable']['inverseJoinColumns'][0]['referencedColumnName']); $this->assertEquals('group-id', $groups['joinTable']['inverseJoinColumns'][0]['referencedColumnName']);
} }
/**
* @group DDC-3427
*/
public function testAcceptsEntityManagerInterfaceInstances()
{
$classMetadataFactory = new ClassMetadataFactory();
/* @var $entityManager \Doctrine\ORM\EntityManager */
$entityManager = $this->getMock('Doctrine\\ORM\\EntityManagerInterface');
$classMetadataFactory->setEntityManager($entityManager);
// not really the cleanest way to check it, but we won't add a getter to the CMF just for the sake of testing.
$this->assertAttributeSame($entityManager, 'em', $classMetadataFactory);
}
} }
/* Test subject class with overridden factory method for mocking purposes */ /* Test subject class with overridden factory method for mocking purposes */