From f904b76ce7efe5c984069528f52ca12054e3431c Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Wed, 28 Jul 2021 21:25:07 +0000 Subject: [PATCH] [TESTS][DataFixtures] Add password and email to created test user --- src/DataFixtures/CoreFixtures.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DataFixtures/CoreFixtures.php b/src/DataFixtures/CoreFixtures.php index 9effa7e7ff..6d39642e14 100644 --- a/src/DataFixtures/CoreFixtures.php +++ b/src/DataFixtures/CoreFixtures.php @@ -18,10 +18,11 @@ class CoreFixtures extends Fixture { $actors = []; $local_entities = []; - foreach ([LocalUser::class => ['taken_user', 'setId'], LocalGroup::class => ['taken_group', 'setGroupId']] as $entity => [$nick, $method]) { + foreach ([LocalUser::class => ['taken_user', 'setId', ['password' => LocalUser::hashPassword('foobar'), 'outgoing_email' => 'email@provider']], LocalGroup::class => ['taken_group', 'setGroupId', []]] + as $entity => [$nick, $method, $extra_create]) { $actor = GSActor::create(['nickname' => $nick, 'normalized_nickname' => Nickname::normalize($nick, check_already_used: false)]); $manager->persist($actor); - $ent = $entity::create(['nickname' => $nick]); + $ent = $entity::create(array_merge(['nickname' => $nick], $extra_create)); // cannot use array spread for arrays with string keys $ent->{$method}($actor->getId()); $local_entities[$nick] = $ent; $manager->persist($ent);