public function testGetIdentifierWhenHasNotBeenManagedYetByUnitOfWork()
 {
     $role = new Role();
     $identitiesExpected = ['id' => 1];
     /** @var UnitOfWork | ProphecyInterface $uow */
     $uow = $this->prophesize(UnitOfWork::class);
     $uow->isInIdentityMap($role)->shouldBeCalledTimes(2)->willReturn(true, false);
     /** @var ClassMetadata $classMetadata */
     $classMetadata = $this->prophesize(ClassMetadata::class);
     $classMetadata->getIdentifierValues($role)->shouldBeCalled()->willReturn($identitiesExpected);
     /** @var EntityManagerInterface | ProphecyInterface $em */
     $em = $this->prophesize(EntityManagerInterface::class);
     $em->getUnitOfWork()->shouldBeCalled()->willReturn($uow);
     $em->getClassMetadata(Role::class)->shouldBeCalled()->willReturn($classMetadata);
     $referenceRepository = new ReferenceRepository($em->reveal());
     $referenceRepository->setReference('entity', $role);
     $identities = $referenceRepository->getIdentities();
     $this->assertEquals($identitiesExpected, $identities['entity']);
 }