From: Raphaƫl Gertz Date: Sat, 2 Nov 2024 03:21:06 +0000 (+0100) Subject: Add note about hashed password X-Git-Tag: 0.5.2~3 X-Git-Url: https://git.rapsys.eu/userbundle/commitdiff_plain/e7388a5cab1529c9bc3252aeb853b7c6d6f72f55?ds=inline;hp=36b915d742bd765c0495ff015430710444e1b5d5 Add note about hashed password Fix base mail Cleanup --- diff --git a/Fixture/UserFixture.php b/Fixture/UserFixture.php index 01a7e8a..2437a8d 100644 --- a/Fixture/UserFixture.php +++ b/Fixture/UserFixture.php @@ -26,12 +26,12 @@ class UserFixture extends Fixture { /** * Config array */ - protected array $config; + private array $config; /** * Air fixtures constructor */ - public function __construct(protected ContainerInterface $container, protected UserPasswordHasherInterface $hasher) { + public function __construct(private ContainerInterface $container, private UserPasswordHasherInterface $hasher) { //Retrieve config $this->config = $container->getParameter(RapsysUserBundle::getAlias()); } @@ -81,7 +81,7 @@ class UserFixture extends Fixture { [ 'civility' => 'Mister', 'group' => 'Admin', - 'mail' => 'admin@example.com', + 'mail' => 'contact@example.com', 'forename' => 'Forename', 'surname' => 'Surname', 'password' => 'test', @@ -93,7 +93,7 @@ class UserFixture extends Fixture { $users = []; foreach($userTree as $userData) { $user = new $this->config['class']['user']($userData['mail'], $userData['password'], $civilitys[$userData['civility']], $userData['forename'], $userData['surname'], $userData['active']); - #TODO: check that password is hashed correctly !!! + //XXX: required to store a hashed password $user->setPassword($this->hasher->hashPassword($user, $userData['password'])); $user->addGroup($groups[$userData['group']]); $manager->persist($user);