Skip to content

Commit

Permalink
[DoctrineBridge] Added a failing test showing the issue for proxy users
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Dec 19, 2011
1 parent 4316595 commit 29f4111
Showing 1 changed file with 17 additions and 0 deletions.
Expand Up @@ -75,6 +75,23 @@ public function testRefreshInvalidUser()
$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);
Expand Down

0 comments on commit 29f4111

Please sign in to comment.