[DoctrineBridge] Added a failing test showing the issue for proxy users

This commit is contained in:
Christophe Coevoet 2011-12-19 18:31:29 +01:00
parent 4316595dbb
commit 29f4111f3e

View File

@ -75,6 +75,23 @@ class EntityUserProviderTest extends DoctrineOrmTestCase
$provider->refreshUser($user2);
}
public function testSupportProxy()
{
$em = $this->createTestEntityManager();
$this->createSchema($em);
$user1 = new CompositeIdentEntity(1, 1, 'user1');
$em->persist($user1);
$em->flush();
$em->clear();
$provider = new EntityUserProvider($em, 'Symfony\Tests\Bridge\Doctrine\Fixtures\CompositeIdentEntity', 'name');
$user2 = $em->getReference('Symfony\Tests\Bridge\Doctrine\Fixtures\CompositeIdentEntity', array('id1' => 1, 'id2' => 1));
$this->assertTrue($provider->supportsClass(get_class($user2)));
}
private function createSchema($em)
{
$schemaTool = new SchemaTool($em);