public function getsReference() { $user = new User(); $this->em->persist($user); $this->em->flush(); $this->assertInstanceOf('FactoryGirl\\Tests\\Provider\\Doctrine\\ORM\\TestEntity\\User', $this->repository->getReference($user->id)); }