From db9b6d8d0d9f943fe321ea690701662dac828e94 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 26 Nov 2018 20:00:01 +0100 Subject: Update fixtures --- .../DataFixtures/AnnotationFixtures.php | 50 +++++++++ .../DataFixtures/ORM/LoadAnnotationData.php | 45 -------- .../CoreBundle/DataFixtures/ConfigFixtures.php | 70 ++++++++++++ .../CoreBundle/DataFixtures/EntryFixtures.php | 123 +++++++++++++++++++++ .../CoreBundle/DataFixtures/ORM/LoadConfigData.php | 67 ----------- .../CoreBundle/DataFixtures/ORM/LoadEntryData.php | 119 -------------------- .../DataFixtures/ORM/LoadSettingData.php | 47 -------- .../DataFixtures/ORM/LoadSiteCredentialData.php | 34 ------ .../CoreBundle/DataFixtures/ORM/LoadTagData.php | 55 --------- .../DataFixtures/ORM/LoadTaggingRuleData.php | 56 ---------- .../CoreBundle/DataFixtures/SettingFixtures.php | 39 +++++++ .../DataFixtures/SiteCredentialFixtures.php | 37 +++++++ .../CoreBundle/DataFixtures/TagFixtures.php | 47 ++++++++ .../DataFixtures/TaggingRuleFixtures.php | 58 ++++++++++ .../UserBundle/DataFixtures/ORM/LoadUserData.php | 61 ---------- .../UserBundle/DataFixtures/UserFixtures.php | 52 +++++++++ 16 files changed, 476 insertions(+), 484 deletions(-) create mode 100644 src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php delete mode 100644 src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php delete mode 100644 src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php create mode 100644 src/Wallabag/UserBundle/DataFixtures/UserFixtures.php (limited to 'src') diff --git a/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php b/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php new file mode 100644 index 00000000..ed46cea9 --- /dev/null +++ b/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php @@ -0,0 +1,50 @@ +getReference('admin-user')); + $annotation1->setEntry($this->getReference('entry1')); + $annotation1->setText('This is my annotation /o/'); + $annotation1->setQuote('content'); + + $manager->persist($annotation1); + + $this->addReference('annotation1', $annotation1); + + $annotation2 = new Annotation($this->getReference('admin-user')); + $annotation2->setEntry($this->getReference('entry2')); + $annotation2->setText('This is my 2nd annotation /o/'); + $annotation2->setQuote('content'); + + $manager->persist($annotation2); + + $this->addReference('annotation2', $annotation2); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + EntryFixtures::class, + UserFixtures::class, + ]; + } +} diff --git a/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php b/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php deleted file mode 100644 index 20e07fa3..00000000 --- a/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php +++ /dev/null @@ -1,45 +0,0 @@ -getReference('admin-user')); - $annotation1->setEntry($this->getReference('entry1')); - $annotation1->setText('This is my annotation /o/'); - $annotation1->setQuote('content'); - - $manager->persist($annotation1); - - $this->addReference('annotation1', $annotation1); - - $annotation2 = new Annotation($this->getReference('admin-user')); - $annotation2->setEntry($this->getReference('entry2')); - $annotation2->setText('This is my 2nd annotation /o/'); - $annotation2->setQuote('content'); - - $manager->persist($annotation2); - - $this->addReference('annotation2', $annotation2); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 35; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php new file mode 100644 index 00000000..c54e9f2c --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php @@ -0,0 +1,70 @@ +getReference('admin-user')); + + $adminConfig->setTheme('material'); + $adminConfig->setItemsPerPage(30); + $adminConfig->setReadingSpeed(1); + $adminConfig->setLanguage('en'); + $adminConfig->setPocketConsumerKey('xxxxx'); + $adminConfig->setActionMarkAsRead(0); + $adminConfig->setListMode(0); + + $manager->persist($adminConfig); + + $this->addReference('admin-config', $adminConfig); + + $bobConfig = new Config($this->getReference('bob-user')); + $bobConfig->setTheme('default'); + $bobConfig->setItemsPerPage(10); + $bobConfig->setReadingSpeed(1); + $bobConfig->setLanguage('fr'); + $bobConfig->setPocketConsumerKey(null); + $bobConfig->setActionMarkAsRead(1); + $bobConfig->setListMode(1); + + $manager->persist($bobConfig); + + $this->addReference('bob-config', $bobConfig); + + $emptyConfig = new Config($this->getReference('empty-user')); + $emptyConfig->setTheme('material'); + $emptyConfig->setItemsPerPage(10); + $emptyConfig->setReadingSpeed(1); + $emptyConfig->setLanguage('en'); + $emptyConfig->setPocketConsumerKey(null); + $emptyConfig->setActionMarkAsRead(0); + $emptyConfig->setListMode(0); + + $manager->persist($emptyConfig); + + $this->addReference('empty-config', $emptyConfig); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + UserFixtures::class, + ]; + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php new file mode 100644 index 00000000..0bd58487 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php @@ -0,0 +1,123 @@ +getReference('admin-user')); + $entry1->setUrl('http://0.0.0.0/entry1'); + $entry1->setReadingTime(11); + $entry1->setDomainName('domain.io'); + $entry1->setMimetype('text/html'); + $entry1->setTitle('test title entry1'); + $entry1->setContent('This is my content /o/'); + $entry1->setLanguage('en'); + + $entry1->addTag($this->getReference('foo-tag')); + $entry1->addTag($this->getReference('baz-tag')); + + $manager->persist($entry1); + + $this->addReference('entry1', $entry1); + + $entry2 = new Entry($this->getReference('admin-user')); + $entry2->setUrl('http://0.0.0.0/entry2'); + $entry2->setReadingTime(1); + $entry2->setDomainName('domain.io'); + $entry2->setMimetype('text/html'); + $entry2->setTitle('test title entry2'); + $entry2->setContent('This is my content /o/'); + $entry2->setOriginUrl('ftp://oneftp.tld'); + $entry2->setLanguage('fr'); + + $manager->persist($entry2); + + $this->addReference('entry2', $entry2); + + $entry3 = new Entry($this->getReference('bob-user')); + $entry3->setUrl('http://0.0.0.0/entry3'); + $entry3->setReadingTime(1); + $entry3->setDomainName('domain.io'); + $entry3->setMimetype('text/html'); + $entry3->setTitle('test title entry3'); + $entry3->setContent('This is my content /o/'); + $entry3->setLanguage('en'); + + $entry3->addTag($this->getReference('foo-tag')); + $entry3->addTag($this->getReference('bar-tag')); + + $manager->persist($entry3); + + $this->addReference('entry3', $entry3); + + $entry4 = new Entry($this->getReference('admin-user')); + $entry4->setUrl('http://0.0.0.0/entry4'); + $entry4->setReadingTime(12); + $entry4->setDomainName('domain.io'); + $entry4->setMimetype('text/html'); + $entry4->setTitle('test title entry4'); + $entry4->setContent('This is my content /o/'); + $entry4->setLanguage('en'); + + $entry4->addTag($this->getReference('foo-tag')); + $entry4->addTag($this->getReference('bar-tag')); + + $manager->persist($entry4); + + $this->addReference('entry4', $entry4); + + $entry5 = new Entry($this->getReference('admin-user')); + $entry5->setUrl('http://0.0.0.0/entry5'); + $entry5->setReadingTime(12); + $entry5->setDomainName('domain.io'); + $entry5->setMimetype('text/html'); + $entry5->setTitle('test title entry5'); + $entry5->setContent('This is my content /o/'); + $entry5->setStarred(true); + $entry5->setLanguage('fr'); + $entry5->setPreviewPicture('http://0.0.0.0/image.jpg'); + + $manager->persist($entry5); + + $this->addReference('entry5', $entry5); + + $entry6 = new Entry($this->getReference('admin-user')); + $entry6->setUrl('http://0.0.0.0/entry6'); + $entry6->setReadingTime(12); + $entry6->setDomainName('domain.io'); + $entry6->setMimetype('text/html'); + $entry6->setTitle('test title entry6'); + $entry6->setContent('This is my content /o/'); + $entry6->updateArchived(true); + $entry6->setLanguage('de'); + $entry6->addTag($this->getReference('bar-tag')); + + $manager->persist($entry6); + + $this->addReference('entry6', $entry6); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + UserFixtures::class, + TagFixtures::class, + ]; + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php deleted file mode 100644 index 3d4d5def..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php +++ /dev/null @@ -1,67 +0,0 @@ -getReference('admin-user')); - - $adminConfig->setTheme('material'); - $adminConfig->setItemsPerPage(30); - $adminConfig->setReadingSpeed(1); - $adminConfig->setLanguage('en'); - $adminConfig->setPocketConsumerKey('xxxxx'); - $adminConfig->setActionMarkAsRead(0); - $adminConfig->setListMode(0); - - $manager->persist($adminConfig); - - $this->addReference('admin-config', $adminConfig); - - $bobConfig = new Config($this->getReference('bob-user')); - $bobConfig->setTheme('default'); - $bobConfig->setItemsPerPage(10); - $bobConfig->setReadingSpeed(1); - $bobConfig->setLanguage('fr'); - $bobConfig->setPocketConsumerKey(null); - $bobConfig->setActionMarkAsRead(1); - $bobConfig->setListMode(1); - - $manager->persist($bobConfig); - - $this->addReference('bob-config', $bobConfig); - - $emptyConfig = new Config($this->getReference('empty-user')); - $emptyConfig->setTheme('material'); - $emptyConfig->setItemsPerPage(10); - $emptyConfig->setReadingSpeed(1); - $emptyConfig->setLanguage('en'); - $emptyConfig->setPocketConsumerKey(null); - $emptyConfig->setActionMarkAsRead(0); - $emptyConfig->setListMode(0); - - $manager->persist($emptyConfig); - - $this->addReference('empty-config', $emptyConfig); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 20; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php deleted file mode 100644 index 62fb5fa6..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ /dev/null @@ -1,119 +0,0 @@ -getReference('admin-user')); - $entry1->setUrl('http://0.0.0.0/entry1'); - $entry1->setReadingTime(11); - $entry1->setDomainName('domain.io'); - $entry1->setMimetype('text/html'); - $entry1->setTitle('test title entry1'); - $entry1->setContent('This is my content /o/'); - $entry1->setLanguage('en'); - - $entry1->addTag($this->getReference('foo-tag')); - $entry1->addTag($this->getReference('baz-tag')); - - $manager->persist($entry1); - - $this->addReference('entry1', $entry1); - - $entry2 = new Entry($this->getReference('admin-user')); - $entry2->setUrl('http://0.0.0.0/entry2'); - $entry2->setReadingTime(1); - $entry2->setDomainName('domain.io'); - $entry2->setMimetype('text/html'); - $entry2->setTitle('test title entry2'); - $entry2->setContent('This is my content /o/'); - $entry2->setOriginUrl('ftp://oneftp.tld'); - $entry2->setLanguage('fr'); - - $manager->persist($entry2); - - $this->addReference('entry2', $entry2); - - $entry3 = new Entry($this->getReference('bob-user')); - $entry3->setUrl('http://0.0.0.0/entry3'); - $entry3->setReadingTime(1); - $entry3->setDomainName('domain.io'); - $entry3->setMimetype('text/html'); - $entry3->setTitle('test title entry3'); - $entry3->setContent('This is my content /o/'); - $entry3->setLanguage('en'); - - $entry3->addTag($this->getReference('foo-tag')); - $entry3->addTag($this->getReference('bar-tag')); - - $manager->persist($entry3); - - $this->addReference('entry3', $entry3); - - $entry4 = new Entry($this->getReference('admin-user')); - $entry4->setUrl('http://0.0.0.0/entry4'); - $entry4->setReadingTime(12); - $entry4->setDomainName('domain.io'); - $entry4->setMimetype('text/html'); - $entry4->setTitle('test title entry4'); - $entry4->setContent('This is my content /o/'); - $entry4->setLanguage('en'); - - $entry4->addTag($this->getReference('foo-tag')); - $entry4->addTag($this->getReference('bar-tag')); - - $manager->persist($entry4); - - $this->addReference('entry4', $entry4); - - $entry5 = new Entry($this->getReference('admin-user')); - $entry5->setUrl('http://0.0.0.0/entry5'); - $entry5->setReadingTime(12); - $entry5->setDomainName('domain.io'); - $entry5->setMimetype('text/html'); - $entry5->setTitle('test title entry5'); - $entry5->setContent('This is my content /o/'); - $entry5->setStarred(true); - $entry5->setLanguage('fr'); - $entry5->setPreviewPicture('http://0.0.0.0/image.jpg'); - - $manager->persist($entry5); - - $this->addReference('entry5', $entry5); - - $entry6 = new Entry($this->getReference('admin-user')); - $entry6->setUrl('http://0.0.0.0/entry6'); - $entry6->setReadingTime(12); - $entry6->setDomainName('domain.io'); - $entry6->setMimetype('text/html'); - $entry6->setTitle('test title entry6'); - $entry6->setContent('This is my content /o/'); - $entry6->updateArchived(true); - $entry6->setLanguage('de'); - $entry6->addTag($this->getReference('bar-tag')); - - $manager->persist($entry6); - - $this->addReference('entry6', $entry6); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 30; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php deleted file mode 100644 index 3fe88e7f..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ /dev/null @@ -1,47 +0,0 @@ -container = $container; - } - - /** - * {@inheritdoc} - */ - public function load(ObjectManager $manager) - { - foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { - $newSetting = new Setting(); - $newSetting->setName($setting['name']); - $newSetting->setValue($setting['value']); - $newSetting->setSection($setting['section']); - $manager->persist($newSetting); - } - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 29; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php deleted file mode 100644 index 866f55a4..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php +++ /dev/null @@ -1,34 +0,0 @@ -getReference('admin-user')); - $credential->setHost('example.com'); - $credential->setUsername('foo'); - $credential->setPassword('bar'); - - $manager->persist($credential); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 50; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php deleted file mode 100644 index 0ecfd18b..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php +++ /dev/null @@ -1,55 +0,0 @@ -setLabel('foo bar'); - - $manager->persist($tag1); - - $this->addReference('foo-bar-tag', $tag1); - - $tag2 = new Tag(); - $tag2->setLabel('bar'); - - $manager->persist($tag2); - - $this->addReference('bar-tag', $tag2); - - $tag3 = new Tag(); - $tag3->setLabel('baz'); - - $manager->persist($tag3); - - $this->addReference('baz-tag', $tag3); - - $tag4 = new Tag(); - $tag4->setLabel('foo'); - - $manager->persist($tag4); - - $this->addReference('foo-tag', $tag4); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 25; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php deleted file mode 100644 index 55abd63c..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php +++ /dev/null @@ -1,56 +0,0 @@ -setRule('content matches "spurs"'); - $tr1->setTags(['sport']); - $tr1->setConfig($this->getReference('admin-config')); - - $manager->persist($tr1); - - $tr2 = new TaggingRule(); - $tr2->setRule('content matches "basket"'); - $tr2->setTags(['sport']); - $tr2->setConfig($this->getReference('admin-config')); - - $manager->persist($tr2); - - $tr3 = new TaggingRule(); - - $tr3->setRule('title matches "wallabag"'); - $tr3->setTags(['wallabag']); - $tr3->setConfig($this->getReference('admin-config')); - - $manager->persist($tr3); - - $tr4 = new TaggingRule(); - $tr4->setRule('content notmatches "basket"'); - $tr4->setTags(['foot']); - $tr4->setConfig($this->getReference('admin-config')); - - $manager->persist($tr4); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 40; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php new file mode 100644 index 00000000..fd129829 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php @@ -0,0 +1,39 @@ +container = $container; + } + + /** + * {@inheritdoc} + */ + public function load(ObjectManager $manager) + { + foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { + $newSetting = new Setting(); + $newSetting->setName($setting['name']); + $newSetting->setValue($setting['value']); + $newSetting->setSection($setting['section']); + $manager->persist($newSetting); + } + + $manager->flush(); + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php new file mode 100644 index 00000000..c73173e8 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php @@ -0,0 +1,37 @@ +getReference('admin-user')); + $credential->setHost('example.com'); + $credential->setUsername('foo'); + $credential->setPassword('bar'); + + $manager->persist($credential); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + UserFixtures::class, + ]; + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php new file mode 100644 index 00000000..803ad778 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php @@ -0,0 +1,47 @@ +setLabel('foo bar'); + + $manager->persist($tag1); + + $this->addReference('foo-bar-tag', $tag1); + + $tag2 = new Tag(); + $tag2->setLabel('bar'); + + $manager->persist($tag2); + + $this->addReference('bar-tag', $tag2); + + $tag3 = new Tag(); + $tag3->setLabel('baz'); + + $manager->persist($tag3); + + $this->addReference('baz-tag', $tag3); + + $tag4 = new Tag(); + $tag4->setLabel('foo'); + + $manager->persist($tag4); + + $this->addReference('foo-tag', $tag4); + + $manager->flush(); + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php new file mode 100644 index 00000000..78ff314a --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php @@ -0,0 +1,58 @@ +setRule('content matches "spurs"'); + $tr1->setTags(['sport']); + $tr1->setConfig($this->getReference('admin-config')); + + $manager->persist($tr1); + + $tr2 = new TaggingRule(); + $tr2->setRule('content matches "basket"'); + $tr2->setTags(['sport']); + $tr2->setConfig($this->getReference('admin-config')); + + $manager->persist($tr2); + + $tr3 = new TaggingRule(); + + $tr3->setRule('title matches "wallabag"'); + $tr3->setTags(['wallabag']); + $tr3->setConfig($this->getReference('admin-config')); + + $manager->persist($tr3); + + $tr4 = new TaggingRule(); + $tr4->setRule('content notmatches "basket"'); + $tr4->setTags(['foot']); + $tr4->setConfig($this->getReference('admin-config')); + + $manager->persist($tr4); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + ConfigFixtures::class, + ]; + } +} 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