adding email to fake users

This commit is contained in:
Julien Fastré 2018-09-11 11:46:19 +02:00
parent 2de25bc1af
commit b7d544f577

View File

@ -64,12 +64,15 @@ class LoadUsers extends AbstractFixture implements OrderedFixtureInterface, Cont
$user = new User(); $user = new User();
$user->setUsername($username) $user
->setPassword( ->setUsername($username)
$this->container->get('security.encoder_factory') ->setPassword(
->getEncoder($user) $this->container->get('security.encoder_factory')
->encodePassword('password', $user->getSalt()) ->getEncoder($user)
); ->encodePassword('password', $user->getSalt())
)
->setEmail(sprintf("%s@chill.social", \str_replace(' ', '', $username)))
;
foreach ($params['groupCenterRefs'] as $groupCenterRef) { foreach ($params['groupCenterRefs'] as $groupCenterRef) {
$user->addGroupCenter($this->getReference($groupCenterRef)); $user->addGroupCenter($this->getReference($groupCenterRef));