forked from wallabag/wallabag
Add some fixtures
Improve test, so user can login Fix some leftJoin Cleanup EntryController
This commit is contained in:
35
src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
Normal file
35
src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures\ORM;
|
||||
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
$entry1 = new Entry($this->getReference('admin-user'));
|
||||
$entry1->setUrl('http://0.0.0.0');
|
||||
$entry1->setTitle('test title');
|
||||
$entry1->setContent('This is my content /o/');
|
||||
|
||||
$manager->persist($entry1);
|
||||
$manager->flush();
|
||||
|
||||
$this->addReference('entry1', $entry1);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user