3 namespace Wallabag\UserBundle\DataFixtures
;
5 use Doctrine\Bundle\FixturesBundle\Fixture
;
6 use Doctrine\Common\Persistence\ObjectManager
;
7 use Wallabag\UserBundle\Entity\User
;
9 class UserFixtures
extends Fixture
14 public function load(ObjectManager
$manager)
16 $userAdmin = new User();
17 $userAdmin->setName('Big boss');
18 $userAdmin->setEmail('bigboss@wallabag.org');
19 $userAdmin->setUsername('admin');
20 $userAdmin->setPlainPassword('mypassword');
21 $userAdmin->setEnabled(true);
22 $userAdmin->addRole('ROLE_SUPER_ADMIN');
24 $manager->persist($userAdmin);
26 $this->addReference('admin-user', $userAdmin);
28 $bobUser = new User();
29 $bobUser->setName('Bobby');
30 $bobUser->setEmail('bobby@wallabag.org');
31 $bobUser->setUsername('bob');
32 $bobUser->setPlainPassword('mypassword');
33 $bobUser->setEnabled(true);
35 $manager->persist($bobUser);
37 $this->addReference('bob-user', $bobUser);
39 $emptyUser = new User();
40 $emptyUser->setName('Empty');
41 $emptyUser->setEmail('empty@wallabag.org');
42 $emptyUser->setUsername('empty');
43 $emptyUser->setPlainPassword('mypassword');
44 $emptyUser->setEnabled(true);
46 $manager->persist($emptyUser);
48 $this->addReference('empty-user', $emptyUser);