diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2018-11-26 20:00:01 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2018-11-28 22:04:54 +0100 |
commit | db9b6d8d0d9f943fe321ea690701662dac828e94 (patch) | |
tree | 165dae22924a69a087f01434d131b5e389b10535 /src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php | |
parent | 9394e8098a92c849d15c43dcd0c338887bff68ce (diff) | |
download | wallabag-db9b6d8d0d9f943fe321ea690701662dac828e94.tar.gz wallabag-db9b6d8d0d9f943fe321ea690701662dac828e94.tar.zst wallabag-db9b6d8d0d9f943fe321ea690701662dac828e94.zip |
Update fixtures
Diffstat (limited to 'src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php')
-rw-r--r-- | src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php deleted file mode 100644 index 26dbda3b..00000000 --- a/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\UserBundle\DataFixtures\ORM; | ||
4 | |||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | ||
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||
7 | use Doctrine\Common\Persistence\ObjectManager; | ||
8 | use Wallabag\UserBundle\Entity\User; | ||
9 | |||
10 | class LoadUserData extends AbstractFixture implements OrderedFixtureInterface | ||
11 | { | ||
12 | /** | ||
13 | * {@inheritdoc} | ||
14 | */ | ||
15 | public function load(ObjectManager $manager) | ||
16 | { | ||
17 | $userAdmin = new User(); | ||
18 | $userAdmin->setName('Big boss'); | ||
19 | $userAdmin->setEmail('bigboss@wallabag.org'); | ||
20 | $userAdmin->setUsername('admin'); | ||
21 | $userAdmin->setPlainPassword('mypassword'); | ||
22 | $userAdmin->setEnabled(true); | ||
23 | $userAdmin->addRole('ROLE_SUPER_ADMIN'); | ||
24 | |||
25 | $manager->persist($userAdmin); | ||
26 | |||
27 | $this->addReference('admin-user', $userAdmin); | ||
28 | |||
29 | $bobUser = new User(); | ||
30 | $bobUser->setName('Bobby'); | ||
31 | $bobUser->setEmail('bobby@wallabag.org'); | ||
32 | $bobUser->setUsername('bob'); | ||
33 | $bobUser->setPlainPassword('mypassword'); | ||
34 | $bobUser->setEnabled(true); | ||
35 | |||
36 | $manager->persist($bobUser); | ||
37 | |||
38 | $this->addReference('bob-user', $bobUser); | ||
39 | |||
40 | $emptyUser = new User(); | ||
41 | $emptyUser->setName('Empty'); | ||
42 | $emptyUser->setEmail('empty@wallabag.org'); | ||
43 | $emptyUser->setUsername('empty'); | ||
44 | $emptyUser->setPlainPassword('mypassword'); | ||
45 | $emptyUser->setEnabled(true); | ||
46 | |||
47 | $manager->persist($emptyUser); | ||
48 | |||
49 | $this->addReference('empty-user', $emptyUser); | ||
50 | |||
51 | $manager->flush(); | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * {@inheritdoc} | ||
56 | */ | ||
57 | public function getOrder() | ||
58 | { | ||
59 | return 10; | ||
60 | } | ||
61 | } | ||