aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-05-05 14:54:03 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2017-05-05 14:54:03 +0200
commit89f108b45ae94cd827595461b39f869111092579 (patch)
treead4b3a5b9bc5798d211fb210cc9fa5dad991153b
parentd09fe4d233477d5cb9bfc613799b05a7ca14e270 (diff)
downloadwallabag-89f108b45ae94cd827595461b39f869111092579.tar.gz
wallabag-89f108b45ae94cd827595461b39f869111092579.tar.zst
wallabag-89f108b45ae94cd827595461b39f869111092579.zip
Fixed @j0k3r review
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php4
-rw-r--r--tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php6
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
403 */ 403 */
404 public function findAllByUrlAndUserId($url, $userId) 404 public function findAllByUrlAndUserId($url, $userId)
405 { 405 {
406 $res = $this->createQueryBuilder('e') 406 return $this->createQueryBuilder('e')
407 ->where('e.url = :url')->setParameter('url', urldecode($url)) 407 ->where('e.url = :url')->setParameter('url', urldecode($url))
408 ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) 408 ->andWhere('e.user = :user_id')->setParameter('user_id', $userId)
409 ->getQuery() 409 ->getQuery()
410 ->getResult(); 410 ->getResult();
411
412 return $res;
413 } 411 }
414} 412}
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;
10 10
11class CleanDuplicatesCommandTest extends WallabagCoreTestCase 11class CleanDuplicatesCommandTest extends WallabagCoreTestCase
12{ 12{
13 public function testTagAll() 13 public function testRunCleanDuplicates()
14 { 14 {
15 $application = new Application($this->getClient()->getKernel()); 15 $application = new Application($this->getClient()->getKernel());
16 $application->add(new CleanDuplicatesCommand()); 16 $application->add(new CleanDuplicatesCommand());
@@ -26,7 +26,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
26 $this->assertContains('Finished cleaning. 0 duplicates found in total', $tester->getDisplay()); 26 $this->assertContains('Finished cleaning. 0 duplicates found in total', $tester->getDisplay());
27 } 27 }
28 28
29 public function testRunTagAllCommandWithBadUsername() 29 public function testRunCleanDuplicatesCommandWithBadUsername()
30 { 30 {
31 $application = new Application($this->getClient()->getKernel()); 31 $application = new Application($this->getClient()->getKernel());
32 $application->add(new CleanDuplicatesCommand()); 32 $application->add(new CleanDuplicatesCommand());
@@ -42,7 +42,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
42 $this->assertContains('User "unknown" not found', $tester->getDisplay()); 42 $this->assertContains('User "unknown" not found', $tester->getDisplay());
43 } 43 }
44 44
45 public function testRunTagAllCommandForUser() 45 public function testRunCleanDuplicatesCommandForUser()
46 { 46 {
47 $application = new Application($this->getClient()->getKernel()); 47 $application = new Application($this->getClient()->getKernel());
48 $application->add(new CleanDuplicatesCommand()); 48 $application->add(new CleanDuplicatesCommand());