aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php
diff options
context:
space:
mode:
authorlizyn <zhiylin@outlook.com>2020-02-24 10:04:13 +0800
committerGitHub <noreply@github.com>2020-02-24 10:04:13 +0800
commitb19df31d78d881a43bcf6b3215e5fc3781e8e8aa (patch)
treed0d9861694a4b5e5fbfdbeb53c255ecd15fe9328 /src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php
parent4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff)
parent04d918cae0227c06a41d27fb6533dddbf30dfe71 (diff)
downloadwallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.gz
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.zst
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.zip
Merge pull request #1 from wallabag/master
Keep up with the master again
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php
new file mode 100644
index 00000000..58a0d799
--- /dev/null
+++ b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php
@@ -0,0 +1,35 @@
1<?php
2
3namespace Wallabag\CoreBundle\DataFixtures;
4
5use Doctrine\Bundle\FixturesBundle\Fixture;
6use Doctrine\Common\Persistence\ObjectManager;
7use Wallabag\CoreBundle\Entity\Tag;
8
9class TagFixtures extends Fixture
10{
11 /**
12 * {@inheritdoc}
13 */
14 public function load(ObjectManager $manager)
15 {
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 }
32
33 $manager->flush();
34 }
35}