mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-17 17:08:37 +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
|
@ -19,9 +19,7 @@ class EntryController extends Controller
|
|||
*/
|
||||
public function addEntryAction(Request $request)
|
||||
{
|
||||
$repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:User');
|
||||
$user = $repository->find(1);
|
||||
$entry = new Entry($user);
|
||||
$entry = new Entry($this->getUser());
|
||||
|
||||
$form = $this->createFormBuilder($entry)
|
||||
->add('url', 'url')
|
||||
|
@ -61,10 +59,10 @@ class EntryController extends Controller
|
|||
*/
|
||||
public function showUnreadAction()
|
||||
{
|
||||
$repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
|
||||
// TODO don't give the user ID like this
|
||||
// TODO change pagination
|
||||
$entries = $repository->findUnreadByUser(1, 0);
|
||||
$entries = $this->getDoctrine()
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findUnreadByUser($this->getUser()->getId(), 0);
|
||||
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Entry:entries.html.twig',
|
||||
|
@ -80,10 +78,10 @@ class EntryController extends Controller
|
|||
*/
|
||||
public function showArchiveAction()
|
||||
{
|
||||
$repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
|
||||
// TODO don't give the user ID like this
|
||||
// TODO change pagination
|
||||
$entries = $repository->findArchiveByUser(1, 0);
|
||||
$entries = $this->getDoctrine()
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findArchiveByUser($this->getUser()->getId(), 0);
|
||||
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Entry:entries.html.twig',
|
||||
|
@ -99,10 +97,10 @@ class EntryController extends Controller
|
|||
*/
|
||||
public function showStarredAction()
|
||||
{
|
||||
$repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
|
||||
// TODO don't give the user ID like this
|
||||
// TODO change pagination
|
||||
$entries = $repository->findStarredByUser(1, 0);
|
||||
$entries = $this->getDoctrine()
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findStarredByUser($this->getUser()->getId(), 0);
|
||||
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Entry:entries.html.twig',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue