aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php43
1 files changed, 16 insertions, 27 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
index 0ecfd18b..485445c1 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
@@ -14,33 +14,22 @@ class LoadTagData extends AbstractFixture implements OrderedFixtureInterface
14 */ 14 */
15 public function load(ObjectManager $manager) 15 public function load(ObjectManager $manager)
16 { 16 {
17 $tag1 = new Tag(); 17 $tags = [
18 $tag1->setLabel('foo bar'); 18 'foo-bar-tag' => 'foo bar', //tag used for EntryControllerTest
19 19 'bar-tag' => 'bar',
20 $manager->persist($tag1); 20 'baz-tag' => 'baz', // tag used for ExportControllerTest
21 21 'foo-tag' => 'foo',
22 $this->addReference('foo-bar-tag', $tag1); 22 'bob-tag' => 'bob', // tag used for TagRestControllerTest
23 23 ];
24 $tag2 = new Tag(); 24
25 $tag2->setLabel('bar'); 25 foreach ($tags as $reference => $label) {
26 26 $tag = new Tag();
27 $manager->persist($tag2); 27 $tag->setLabel($label);
28 28
29 $this->addReference('bar-tag', $tag2); 29 $manager->persist($tag);
30 30
31 $tag3 = new Tag(); 31 $this->addReference($reference, $tag);
32 $tag3->setLabel('baz'); 32 }
33
34 $manager->persist($tag3);
35
36 $this->addReference('baz-tag', $tag3);
37
38 $tag4 = new Tag();
39 $tag4->setLabel('foo');
40
41 $manager->persist($tag4);
42
43 $this->addReference('foo-tag', $tag4);
44 33
45 $manager->flush(); 34 $manager->flush();
46 } 35 }