X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FDataFixtures%2FORM%2FLoadTagData.php;h=485445c1b99d6061721a217e85d195f6814a9481;hb=bafb9744c87255ebe28945879da85e587175d241;hp=09e99f36bb46b222544d6cfe11484e270231ccac;hpb=8f8654913ce82be12219a37a24630066bbe950c2;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php index 09e99f36..485445c1 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php @@ -14,26 +14,22 @@ class LoadTagData extends AbstractFixture implements OrderedFixtureInterface */ public function load(ObjectManager $manager) { - $tag1 = new Tag(); - $tag1->setLabel('foo'); - - $manager->persist($tag1); - - $this->addReference('foo-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); + $tags = [ + 'foo-bar-tag' => 'foo bar', //tag used for EntryControllerTest + 'bar-tag' => 'bar', + 'baz-tag' => 'baz', // tag used for ExportControllerTest + 'foo-tag' => 'foo', + 'bob-tag' => 'bob', // tag used for TagRestControllerTest + ]; + + foreach ($tags as $reference => $label) { + $tag = new Tag(); + $tag->setLabel($label); + + $manager->persist($tag); + + $this->addReference($reference, $tag); + } $manager->flush(); }