From db9b6d8d0d9f943fe321ea690701662dac828e94 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 26 Nov 2018 20:00:01 +0100 Subject: Update fixtures --- .../UserBundle/DataFixtures/ORM/LoadUserData.php | 61 ---------------------- .../UserBundle/DataFixtures/UserFixtures.php | 52 ++++++++++++++++++ 2 files changed, 52 insertions(+), 61 deletions(-) delete mode 100644 src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php create mode 100644 src/Wallabag/UserBundle/DataFixtures/UserFixtures.php (limited to 'src/Wallabag/UserBundle/DataFixtures') 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 @@ -setName('Big boss'); - $userAdmin->setEmail('bigboss@wallabag.org'); - $userAdmin->setUsername('admin'); - $userAdmin->setPlainPassword('mypassword'); - $userAdmin->setEnabled(true); - $userAdmin->addRole('ROLE_SUPER_ADMIN'); - - $manager->persist($userAdmin); - - $this->addReference('admin-user', $userAdmin); - - $bobUser = new User(); - $bobUser->setName('Bobby'); - $bobUser->setEmail('bobby@wallabag.org'); - $bobUser->setUsername('bob'); - $bobUser->setPlainPassword('mypassword'); - $bobUser->setEnabled(true); - - $manager->persist($bobUser); - - $this->addReference('bob-user', $bobUser); - - $emptyUser = new User(); - $emptyUser->setName('Empty'); - $emptyUser->setEmail('empty@wallabag.org'); - $emptyUser->setUsername('empty'); - $emptyUser->setPlainPassword('mypassword'); - $emptyUser->setEnabled(true); - - $manager->persist($emptyUser); - - $this->addReference('empty-user', $emptyUser); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 10; - } -} diff --git a/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php b/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php new file mode 100644 index 00000000..1e375e09 --- /dev/null +++ b/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php @@ -0,0 +1,52 @@ +setName('Big boss'); + $userAdmin->setEmail('bigboss@wallabag.org'); + $userAdmin->setUsername('admin'); + $userAdmin->setPlainPassword('mypassword'); + $userAdmin->setEnabled(true); + $userAdmin->addRole('ROLE_SUPER_ADMIN'); + + $manager->persist($userAdmin); + + $this->addReference('admin-user', $userAdmin); + + $bobUser = new User(); + $bobUser->setName('Bobby'); + $bobUser->setEmail('bobby@wallabag.org'); + $bobUser->setUsername('bob'); + $bobUser->setPlainPassword('mypassword'); + $bobUser->setEnabled(true); + + $manager->persist($bobUser); + + $this->addReference('bob-user', $bobUser); + + $emptyUser = new User(); + $emptyUser->setName('Empty'); + $emptyUser->setEmail('empty@wallabag.org'); + $emptyUser->setUsername('empty'); + $emptyUser->setPlainPassword('mypassword'); + $emptyUser->setEnabled(true); + + $manager->persist($emptyUser); + + $this->addReference('empty-user', $emptyUser); + + $manager->flush(); + } +} -- cgit v1.2.3