2015-12-29 14:50:52 +01:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 01:30:12 +01:00
|
|
|
namespace Wallabag\DataFixtures;
|
2015-12-29 14:50:52 +01:00
|
|
|
|
2018-11-26 20:00:01 +01:00
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
2020-06-15 08:25:59 +02:00
|
|
|
use Doctrine\Persistence\ObjectManager;
|
2024-02-19 01:30:12 +01:00
|
|
|
use Wallabag\Entity\Tag;
|
2015-12-29 14:50:52 +01:00
|
|
|
|
2018-11-26 20:00:01 +01:00
|
|
|
class TagFixtures extends Fixture
|
2015-12-29 14:50:52 +01:00
|
|
|
{
|
2020-06-15 08:25:59 +02:00
|
|
|
public function load(ObjectManager $manager): void
|
2015-12-29 14:50:52 +01:00
|
|
|
{
|
2018-12-29 19:22:05 +01:00
|
|
|
$tags = [
|
2024-01-01 19:11:01 +01:00
|
|
|
'foo-bar-tag' => 'foo bar', // tag used for EntryControllerTest
|
2018-12-29 19:22:05 +01:00
|
|
|
'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 12:46:20 +02:00
|
|
|
|
2015-12-29 14:50:52 +01:00
|
|
|
$manager->flush();
|
|
|
|
}
|
|
|
|
}
|