/** * @param ObjectManager $manager */ public function load(ObjectManager $manager) { foreach ($this->users as $user) { $entity = new AccountUser(); $entity->setFirstName($user['first_name'])->setLastName($user['last_name'])->setEmail($user['email'])->setEnabled($user['enabled'])->setPassword($user['password']); $this->setReference($entity->getEmail(), $entity); $manager->persist($entity); } $manager->flush(); }
/** * @return array */ public function submitProvider() { $entity = new AccountUser(); $expectedEntity = new AccountUser(); $expectedEntity->setFirstName('John'); $expectedEntity->setLastName('Doe'); $expectedEntity->setEmail('*****@*****.**'); $entity->setSalt($expectedEntity->getSalt()); return ['new user' => ['defaultData' => $entity, 'submittedData' => ['firstName' => 'John', 'lastName' => 'Doe', 'email' => '*****@*****.**', 'plainPassword' => '123456'], 'expectedData' => $expectedEntity]]; }