From f06f840c9d5e08b81d56e0588dee8249bd2f19af Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 30 May 2016 14:18:47 +0200 Subject: Move fixtures to the right place --- src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php | 6 ------ src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/Wallabag/CoreBundle/DataFixtures') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php index 5a376453..ebfebfea 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php @@ -16,12 +16,6 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager) { $adminConfig = new Config($this->getReference('admin-user')); - $taggingRule = new TaggingRule(); - - $taggingRule->setConfig($adminConfig); - $taggingRule->setRule('title matches "wallabag"'); - $taggingRule->setTags(['wallabag']); - $manager->persist($taggingRule); $adminConfig->setTheme('material'); $adminConfig->setItemsPerPage(30); diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php index 2e1cc270..7efe6356 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php @@ -28,6 +28,14 @@ class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInter $manager->persist($tr2); + $tr3 = new TaggingRule(); + + $tr3->setRule('title matches "wallabag"'); + $tr3->setTags(['wallabag']); + $tr3->setConfig($this->getReference('admin-config')); + + $manager->persist($tr3); + $manager->flush(); } -- cgit v1.2.3 From e42b13bcff41161ecdb4322dce1ef98a401482ca Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 30 May 2016 14:34:11 +0200 Subject: Change ManyToMany between entry & tag Following https://gist.github.com/Ocramius/3121916 Be sure to remove the related entity when removing an entity. Let say you have Entry -> EntryTag -> Tag. If you remove the entry: - before that commit, the EntryTag will stay (at least using SQLite). - with that commit, the related entity is removed --- src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Wallabag/CoreBundle/DataFixtures') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php index ebfebfea..03be9667 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php @@ -6,7 +6,6 @@ use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Wallabag\CoreBundle\Entity\Config; -use Wallabag\CoreBundle\Entity\TaggingRule; class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface { -- cgit v1.2.3 From 267e8d6361f8e7791a8687f2370a3e9d08af6648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 30 Apr 2016 15:03:22 +0200 Subject: Add tests for tag list routes --- src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Wallabag/CoreBundle/DataFixtures') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php index 8553dced..09e99f36 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php @@ -28,6 +28,13 @@ class LoadTagData extends AbstractFixture implements OrderedFixtureInterface $this->addReference('bar-tag', $tag2); + $tag3 = new Tag(); + $tag3->setLabel('baz'); + + $manager->persist($tag3); + + $this->addReference('baz-tag', $tag3); + $manager->flush(); } -- cgit v1.2.3 From d0545b6bd6edc38bf06604900b1e20a60e7c8583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 10 Apr 2016 21:48:11 +0200 Subject: Add migration --- src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Wallabag/CoreBundle/DataFixtures') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php index 09058796..b4309304 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php @@ -15,6 +15,11 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager) { $settings = [ + [ + 'name' => 'share_public', + 'value' => '1', + 'section' => 'entry', + ], [ 'name' => 'carrot', 'value' => '1', -- cgit v1.2.3 From 40d2a29443df8ef6fdf1f2d09b5ba8808543c245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 15 Feb 2016 21:30:55 +0100 Subject: Replace RabbitMQ injection with CraueConfiguration --- src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Wallabag/CoreBundle/DataFixtures') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php index b4309304..778f91ed 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php @@ -95,6 +95,11 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface 'value' => null, 'section' => 'import', ], + [ + 'name' => 'rabbitmq', + 'value' => '0', + 'section' => 'import', + ], [ 'name' => 'show_printlink', 'value' => '1', -- cgit v1.2.3 From b3437d58ae224121375c99e9288d8b808524e624 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 9 Sep 2016 21:02:03 +0200 Subject: Enable Redis async import - using javibravo/simpleue - internal config value are now `import_with_redis` & `import_with_rabbit` which are more clear - if both option are enable rabbit will be choosen - services imports related to async are now splitted into 2 files: `redis.yml` & `rabbit.yml` - --- src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle/DataFixtures') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php index 778f91ed..3ed6bafe 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php @@ -96,7 +96,12 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface 'section' => 'import', ], [ - 'name' => 'rabbitmq', + 'name' => 'import_with_redis', + 'value' => '0', + 'section' => 'import', + ], + [ + 'name' => 'import_with_rabbitmq', 'value' => '0', 'section' => 'import', ], -- cgit v1.2.3 From ebe0787e093f4f2934430033015d6ebad1c64dca Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 16 Sep 2016 22:22:25 +0200 Subject: Moved Pocket token to user config --- src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php | 3 +++ src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/Wallabag/CoreBundle/DataFixtures') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php index 03be9667..921c739f 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php @@ -20,6 +20,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface $adminConfig->setItemsPerPage(30); $adminConfig->setReadingSpeed(1); $adminConfig->setLanguage('en'); + $adminConfig->setPocketConsumerKey('xxxxx'); $manager->persist($adminConfig); @@ -30,6 +31,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface $bobConfig->setItemsPerPage(10); $bobConfig->setReadingSpeed(1); $bobConfig->setLanguage('fr'); + $bobConfig->setPocketConsumerKey(null); $manager->persist($bobConfig); @@ -40,6 +42,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface $emptyConfig->setItemsPerPage(10); $emptyConfig->setReadingSpeed(1); $emptyConfig->setLanguage('en'); + $emptyConfig->setPocketConsumerKey(null); $manager->persist($emptyConfig); diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php index 3ed6bafe..9425f961 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php @@ -90,11 +90,6 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface 'value' => '1', 'section' => 'export', ], - [ - 'name' => 'pocket_consumer_key', - 'value' => null, - 'section' => 'import', - ], [ 'name' => 'import_with_redis', 'value' => '0', -- cgit v1.2.3 From b0458874c85060c992aa1cb78dec91ee85082b74 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 2 Oct 2016 16:06:42 +0200 Subject: Fix relations export for Entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tags & Annotations weren’t really well exported. This is now fixed (+ tests) --- src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Wallabag/CoreBundle/DataFixtures') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index 6c6a331a..fedad009 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php @@ -23,6 +23,9 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $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); @@ -96,6 +99,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $entry6->setContent('This is my content /o/'); $entry6->setArchived(true); $entry6->setLanguage('de'); + $entry6->addTag($this->getReference('bar-tag')); $manager->persist($entry6); -- cgit v1.2.3