From 89f108b45ae94cd827595461b39f869111092579 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 5 May 2017 14:54:03 +0200 Subject: [PATCH] Fixed @j0k3r review --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 4 +--- .../CoreBundle/Command/CleanDuplicatesCommandTest.php | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 2e03fa19..6972e974 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -403,12 +403,10 @@ class EntryRepository extends EntityRepository */ public function findAllByUrlAndUserId($url, $userId) { - $res = $this->createQueryBuilder('e') + return $this->createQueryBuilder('e') ->where('e.url = :url')->setParameter('url', urldecode($url)) ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) ->getQuery() ->getResult(); - - return $res; } } diff --git a/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php b/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php index 1f5921d2..688cc388 100644 --- a/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php @@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Entity\Entry; class CleanDuplicatesCommandTest extends WallabagCoreTestCase { - public function testTagAll() + public function testRunCleanDuplicates() { $application = new Application($this->getClient()->getKernel()); $application->add(new CleanDuplicatesCommand()); @@ -26,7 +26,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase $this->assertContains('Finished cleaning. 0 duplicates found in total', $tester->getDisplay()); } - public function testRunTagAllCommandWithBadUsername() + public function testRunCleanDuplicatesCommandWithBadUsername() { $application = new Application($this->getClient()->getKernel()); $application->add(new CleanDuplicatesCommand()); @@ -42,7 +42,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase $this->assertContains('User "unknown" not found', $tester->getDisplay()); } - public function testRunTagAllCommandForUser() + public function testRunCleanDuplicatesCommandForUser() { $application = new Application($this->getClient()->getKernel()); $application->add(new CleanDuplicatesCommand()); -- 2.41.0