addTestUser(); $manager->flush(); } protected function addTestUser():void{ /** * @var UserManager $userManager */ $userManager = $this->container->get('fos_user.user_manager'); /** * @var User $testUser */ $testUser = $userManager->createUser(); $testUser->setEmail("test@test.de"); $testUser->setUsername("test"); $testUser->setPlainPassword('test'); $testUser->setEnabled(true); $userManager->updateUser($testUser); } }