From 3b815d2de5a852fe2ebad5827bd4c9070aa175ea Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 8 Feb 2015 23:05:51 +0100 Subject: Add some fixtures Improve test, so user can login Fix some leftJoin Cleanup EntryController --- .../CoreBundle/DataFixtures/ORM/LoadEntryData.php | 35 ++++++++++++++++++++++ .../CoreBundle/DataFixtures/ORM/LoadUserData.php | 34 +++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php (limited to 'src/Wallabag/CoreBundle/DataFixtures') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php new file mode 100644 index 00000000..fccd06be --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php @@ -0,0 +1,35 @@ +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; + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php new file mode 100644 index 00000000..da788218 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php @@ -0,0 +1,34 @@ +setUsername('admin'); + $userAdmin->setPassword('test'); + + $manager->persist($userAdmin); + $manager->flush(); + + $this->addReference('admin-user', $userAdmin); + } + + /** + * {@inheritDoc} + */ + public function getOrder() + { + return 10; + } +} -- cgit v1.2.3