setName('ruffy'); $hero->setUser($this->getReference(UserFixtures::ADMIN_USER_REFERENCE)); $manager->persist($hero); $hero = new Hero(); $hero->setName('goku'); $hero->setUser($this->getReference(UserFixtures::DUDE_USER_REFERENCE)); $manager->persist($hero); $manager->flush(); } public function getDependencies() { return array( UserFixtures::class, ); } }