From 273b6f06584092f3b596406bf4c0d57aa738e8bf Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 30 Mar 2017 16:07:48 +0200 Subject: [PATCH] Rename method from *username to *user Signed-off-by: Thomas Citharel --- src/Wallabag/CoreBundle/Controller/EntryController.php | 2 +- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 2 +- tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index f7398e69..8d2ac6d4 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -227,7 +227,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')->countAllEntriesByUsername($this->getUser()->getId()) == 0) { + if ($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 4071301d..9325d261 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -328,7 +328,7 @@ class EntryRepository extends EntityRepository * * @return int */ - public function countAllEntriesByUsername($userId) + public function countAllEntriesByUser($userId) { $qb = $this->createQueryBuilder('e') ->select('count(e)') diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index beb0598a..8f2ca1cb 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php @@ -798,7 +798,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $entryReset = $em ->getRepository('WallabagCoreBundle:Entry') - ->countAllEntriesByUsername($user->getId()); + ->countAllEntriesByUser($user->getId()); $this->assertEquals(0, $entryReset, 'Entries were reset'); } @@ -843,7 +843,7 @@ class ConfigControllerTest extends WallabagCoreTestCase $entryReset = $em ->getRepository('WallabagCoreBundle:Entry') - ->countAllEntriesByUsername($user->getId()); + ->countAllEntriesByUser($user->getId()); $this->assertEquals(0, $entryReset, 'Entries were reset'); -- 2.41.0