forked from wallabag/wallabag
Move source files directly under src/ directory
This commit is contained in:
32
src/DataFixtures/TagFixtures.php
Normal file
32
src/DataFixtures/TagFixtures.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures;
|
||||
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
|
||||
class TagFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user