public function load(\Doctrine\Common\Persistence\ObjectManager $manager)
 {
     $userOne = new UserOne();
     $userOne->setUsername('userone');
     $userOne->setPlainPassword('userone');
     $userOne->setEmail('*****@*****.**');
     $userOne->setEnabled(true);
     $manager->persist($userOne);
     $userTwo = new UserTwo();
     $userTwo->setUsername('usertwo');
     $userTwo->setPlainPassword('usertwo');
     $userTwo->setEmail('*****@*****.**');
     $userTwo->setEnabled(true);
     $manager->persist($userTwo);
     $userOneNotConfirmed = new UserOne();
     $userOneNotConfirmed->setUsername('userone-not-confirmed');
     $userOneNotConfirmed->setPlainPassword('userone-not-confirmed');
     $userOneNotConfirmed->setEmail('*****@*****.**');
     $userOneNotConfirmed->setConfirmationToken('abcdefg');
     $userOneNotConfirmed->setEnabled(false);
     $manager->persist($userOneNotConfirmed);
     $userTwoNotConfirmed = new UserTwo();
     $userTwoNotConfirmed->setUsername('usertwo-not-confirmed');
     $userTwoNotConfirmed->setPlainPassword('usertwo-not-confirmed');
     $userTwoNotConfirmed->setEmail('*****@*****.**');
     $userTwoNotConfirmed->setConfirmationToken('abcdefg');
     $userTwoNotConfirmed->setEnabled(false);
     $manager->persist($userTwoNotConfirmed);
     $manager->flush();
     $this->addReference('user.one', $userOne);
     $this->addReference('user.two', $userTwo);
 }
예제 #2
0
 public function load(\Doctrine\Common\Persistence\ObjectManager $manager)
 {
     $userOne = new UserOne();
     $userOne->setUsername('userone');
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($userOne);
     $userOne->setPassword($encoder->encodePassword('userone', $userOne->getSalt()));
     $userOne->setEmail('*****@*****.**');
     $userOne->setEnabled(true);
     $manager->persist($userOne);
     $userTwo = new UserTwo();
     $userTwo->setUsername('usertwo');
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($userTwo);
     $userTwo->setPassword($encoder->encodePassword('usertwo', $userTwo->getSalt()));
     $userTwo->setEmail('*****@*****.**');
     $userTwo->setEnabled(true);
     $manager->persist($userTwo);
     $userThree = new UserThree();
     $userThree->setUsername('userthree');
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($userThree);
     $userThree->setPassword($encoder->encodePassword('userthree', $userThree->getSalt()));
     $userThree->setEmail('*****@*****.**');
     $userThree->setEnabled(true);
     $manager->persist($userThree);
     $userOneNotConfirmed = new UserOne();
     $userOneNotConfirmed->setUsername('userone-not-confirmed');
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($userOneNotConfirmed);
     $userOneNotConfirmed->setPassword($encoder->encodePassword('userone-not-confirmed', $userOneNotConfirmed->getSalt()));
     $userOneNotConfirmed->setEmail('*****@*****.**');
     $userOneNotConfirmed->setConfirmationToken('abcdefg');
     $userOneNotConfirmed->setEnabled(false);
     $manager->persist($userOneNotConfirmed);
     $userTwoNotConfirmed = new UserTwo();
     $userTwoNotConfirmed->setUsername('usertwo-not-confirmed');
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($userTwoNotConfirmed);
     $userTwoNotConfirmed->setPassword($encoder->encodePassword('usertwo-not-confirmed', $userTwoNotConfirmed->getSalt()));
     $userTwoNotConfirmed->setEmail('*****@*****.**');
     $userTwoNotConfirmed->setConfirmationToken('pkdddfff');
     $userTwoNotConfirmed->setEnabled(false);
     $manager->persist($userTwoNotConfirmed);
     $manager->flush();
     $this->addReference('user.one', $userOne);
     $this->addReference('user.two', $userTwo);
 }