diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures')
-rw-r--r-- | src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index 3be323ed..ce12ec5d 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php | |||
@@ -6,6 +6,7 @@ use Doctrine\Common\DataFixtures\AbstractFixture; | |||
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | 6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; |
7 | use Doctrine\Common\Persistence\ObjectManager; | 7 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Wallabag\CoreBundle\Entity\Entry; | 8 | use Wallabag\CoreBundle\Entity\Entry; |
9 | use Wallabag\CoreBundle\Entity\Tag; | ||
9 | 10 | ||
10 | class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface | 11 | class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface |
11 | { | 12 | { |
@@ -37,10 +38,35 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface | |||
37 | $entry3->setTitle('test title entry3'); | 38 | $entry3->setTitle('test title entry3'); |
38 | $entry3->setContent('This is my content /o/'); | 39 | $entry3->setContent('This is my content /o/'); |
39 | 40 | ||
41 | $tag1 = new Tag($this->getReference('bob-user')); | ||
42 | $tag1->setLabel("foo"); | ||
43 | $tag2 = new Tag($this->getReference('bob-user')); | ||
44 | $tag2->setLabel("bar"); | ||
45 | |||
46 | $entry3->addTag($tag1); | ||
47 | $entry3->addTag($tag2); | ||
48 | |||
40 | $manager->persist($entry3); | 49 | $manager->persist($entry3); |
41 | 50 | ||
42 | $this->addReference('entry3', $entry3); | 51 | $this->addReference('entry3', $entry3); |
43 | 52 | ||
53 | $entry4 = new Entry($this->getReference('admin-user')); | ||
54 | $entry4->setUrl('http://0.0.0.0'); | ||
55 | $entry4->setTitle('test title entry4'); | ||
56 | $entry4->setContent('This is my content /o/'); | ||
57 | |||
58 | $tag1 = new Tag($this->getReference('admin-user')); | ||
59 | $tag1->setLabel("foo"); | ||
60 | $tag2 = new Tag($this->getReference('admin-user')); | ||
61 | $tag2->setLabel("bar"); | ||
62 | |||
63 | $entry4->addTag($tag1); | ||
64 | $entry4->addTag($tag2); | ||
65 | |||
66 | $manager->persist($entry4); | ||
67 | |||
68 | $this->addReference('entry4', $entry4); | ||
69 | |||
44 | $manager->flush(); | 70 | $manager->flush(); |
45 | } | 71 | } |
46 | 72 | ||