setName('admin'); $userAdmin->setPassword('123456789'); $manager->persist($userAdmin); $userDummy = new User(); $userDummy->setName('dummy'); $userDummy->setPassword('1234'); $manager->persist($userDummy); $manager->flush(); $this->addReference(self::ADMIN_USER_REFERENCE, $userAdmin); $this->addReference(self::DUMMY_USER_REFERENCE, $userDummy); } }