From 78833672469f7beb0c4a195aa0a76f7ca4133057 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 15 Jan 2016 15:28:22 +0100 Subject: Fix `findOneByUrl` side effect in tests Fix #1566 --- src/Wallabag/ImportBundle/Import/PocketImport.php | 2 +- src/Wallabag/ImportBundle/Import/WallabagV1Import.php | 2 +- src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php | 2 +- src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Wallabag/ImportBundle') diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index cdcec1e2..72b9047c 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -214,7 +214,7 @@ class PocketImport implements ImportInterface $existingEntry = $this->em ->getRepository('WallabagCoreBundle:Entry') - ->existByUrlAndUserId($url, $this->user->getId()); + ->findByUrlAndUserId($url, $this->user->getId()); if (false !== $existingEntry) { ++$this->skippedEntries; diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index 393089d6..6f8feaf3 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php @@ -127,7 +127,7 @@ class WallabagV1Import implements ImportInterface foreach ($entries as $importedEntry) { $existingEntry = $this->em ->getRepository('WallabagCoreBundle:Entry') - ->existByUrlAndUserId($importedEntry['url'], $this->user->getId()); + ->findByUrlAndUserId($importedEntry['url'], $this->user->getId()); if (false !== $existingEntry) { ++$this->skippedEntries; diff --git a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php index 043b2114..76225fe4 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php @@ -248,7 +248,7 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase ->getMock(); $entryRepo->expects($this->exactly(2)) - ->method('existByUrlAndUserId') + ->method('findByUrlAndUserId') ->will($this->onConsecutiveCalls(false, true)); $tag = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Tag') diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php index d5b41777..90483480 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php @@ -53,7 +53,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase ->getMock(); $entryRepo->expects($this->exactly(3)) - ->method('existByUrlAndUserId') + ->method('findByUrlAndUserId') ->will($this->onConsecutiveCalls(false, true, false)); $this->em -- cgit v1.2.3