]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php
Merge remote-tracking branch 'origin/master' into 2.4
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / TagFixtures.php
CommitLineData
fc732227
JB
1<?php
2
db9b6d8d 3namespace Wallabag\CoreBundle\DataFixtures;
fc732227 4
db9b6d8d 5use Doctrine\Bundle\FixturesBundle\Fixture;
fc732227
JB
6use Doctrine\Common\Persistence\ObjectManager;
7use Wallabag\CoreBundle\Entity\Tag;
8
db9b6d8d 9class TagFixtures extends Fixture
fc732227
JB
10{
11 /**
12 * {@inheritdoc}
13 */
14 public function load(ObjectManager $manager)
15 {
bafb9744
KD
16 $tags = [
17 'foo-bar-tag' => 'foo bar', //tag used for EntryControllerTest
18 'bar-tag' => 'bar',
19 'baz-tag' => 'baz', // tag used for ExportControllerTest
20 'foo-tag' => 'foo',
21 'bob-tag' => 'bob', // tag used for TagRestControllerTest
22 ];
23
24 foreach ($tags as $reference => $label) {
25 $tag = new Tag();
26 $tag->setLabel($label);
27
28 $manager->persist($tag);
29
30 $this->addReference($reference, $tag);
31 }
7c04b739 32
fc732227
JB
33 $manager->flush();
34 }
fc732227 35}