]>
Commit | Line | Data |
---|---|---|
fc732227 JB |
1 | <?php |
2 | ||
db9b6d8d | 3 | namespace Wallabag\CoreBundle\DataFixtures; |
fc732227 | 4 | |
db9b6d8d | 5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
fc732227 JB |
6 | use Doctrine\Common\Persistence\ObjectManager; |
7 | use Wallabag\CoreBundle\Entity\Tag; | |
8 | ||
db9b6d8d | 9 | class 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 | } |