From 38520658addc217f127b0627ea28dcf8d6e6178c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 3 Jul 2017 07:30:54 +0200 Subject: Fix tests --- src/Wallabag/CoreBundle/Controller/EntryController.php | 2 +- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 445cfeeb..845ebef6 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -195,7 +195,7 @@ class EntryController extends Controller public function showUnreadAction(Request $request, $page) { // load the quickstart if no entry in database - if ($page === 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId()) === 0) { + if ((int) $page === 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId()) === 0) { return $this->redirect($this->generateUrl('quickstart')); } diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index a65bfe3b..c27ee90c 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -325,7 +325,7 @@ class EntryRepository extends EntityRepository ->where('e.user=:userId')->setParameter('userId', $userId) ; - return $qb->getQuery()->getSingleScalarResult(); + return (int) $qb->getQuery()->getSingleScalarResult(); } /** @@ -345,7 +345,7 @@ class EntryRepository extends EntityRepository ->andWhere('t.id=:tagId')->setParameter('tagId', $tagId) ; - return $qb->getQuery()->getSingleScalarResult(); + return (int) $qb->getQuery()->getSingleScalarResult(); } /** -- cgit v1.2.3