public function testReferenceIdentityPopulation()
{
$em = $this->getMockSqliteEntityManager();
$referenceRepository = $this->getMockBuilder(ReferenceRepository::class)->setConstructorArgs(array($em))->getMock();
$em->getEventManager()->addEventSubscriber(new ORMReferenceListener($referenceRepository));
$schemaTool = new SchemaTool($em);
$schemaTool->dropSchema(array());
$schemaTool->createSchema(array($em->getClassMetadata(Role::class)));
$referenceRepository->expects($this->once())->method('addReference')->with('admin-role');
$referenceRepository->expects($this->once())->method('getReferenceNames')->will($this->returnValue(array('admin-role')));
$referenceRepository->expects($this->once())->method('setReferenceIdentity')->with('admin-role', array('id' => 1));
$roleFixture = new TestFixtures\RoleFixture();
$roleFixture->setReferenceRepository($referenceRepository);
$roleFixture->load($em);
}