aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/UserBundle/DataFixtures
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2015-10-06 09:19:06 +0200
committerJeremy Benoist <j0k3r@users.noreply.github.com>2015-10-06 09:19:06 +0200
commit16dabc326311f084d671be188c7941bbb3c341c9 (patch)
tree3210a7688ea2bfa1bff5fd0422b52adf570edcdc /src/Wallabag/UserBundle/DataFixtures
parentfdef5f460524215d806e244e5546865f4b8e01df (diff)
parent8263e71192989dc0fd28a41ac22f9c5b32eb11c4 (diff)
downloadwallabag-16dabc326311f084d671be188c7941bbb3c341c9.tar.gz
wallabag-16dabc326311f084d671be188c7941bbb3c341c9.tar.zst
wallabag-16dabc326311f084d671be188c7941bbb3c341c9.zip
Merge pull request #1436 from wallabag/v2-register
Public registration & oAuth2 \o/
Diffstat (limited to 'src/Wallabag/UserBundle/DataFixtures')
-rw-r--r--src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php
new file mode 100644
index 00000000..d48855da
--- /dev/null
+++ b/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php
@@ -0,0 +1,50 @@
1<?php
2
3namespace Wallabag\UserBundle\DataFixtures\ORM;
4
5use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\UserBundle\Entity\User;
9
10class 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 $manager->flush();
41 }
42
43 /**
44 * {@inheritdoc}
45 */
46 public function getOrder()
47 {
48 return 10;
49 }
50}