mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Add some fixtures
Improve test, so user can login Fix some leftJoin Cleanup EntryController
This commit is contained in:
parent
d91691573f
commit
3b815d2de5
11 changed files with 361 additions and 54 deletions
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue