2015-12-29 13:50:52 +00:00
|
|
|
<?php
|
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
namespace Wallabag\CoreBundle\DataFixtures;
|
2015-12-29 13:50:52 +00:00
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
2015-12-29 13:50:52 +00:00
|
|
|
use Doctrine\Common\Persistence\ObjectManager;
|
|
|
|
use Wallabag\CoreBundle\Entity\Tag;
|
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
class TagFixtures extends Fixture
|
2015-12-29 13:50:52 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function load(ObjectManager $manager)
|
|
|
|
{
|
2018-12-29 18:22:05 +00:00
|
|
|
$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);
|
|
|
|
}
|
2017-08-03 10:46:20 +00:00
|
|
|
|
2015-12-29 13:50:52 +00:00
|
|
|
$manager->flush();
|
|
|
|
}
|
|
|
|
}
|