diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-01-15 15:47:13 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-01-15 15:47:13 +0100 |
commit | 86719c63bf47686ca55020e6b0443344de36d45a (patch) | |
tree | e985658fe7e6ae5c5f016417533a36dac4e80f50 /src/Wallabag/ImportBundle | |
parent | 1930c19d8214c05ceefac5ac011a6b6e7e4a983d (diff) | |
parent | 78833672469f7beb0c4a195aa0a76f7ca4133057 (diff) | |
download | wallabag-86719c63bf47686ca55020e6b0443344de36d45a.tar.gz wallabag-86719c63bf47686ca55020e6b0443344de36d45a.tar.zst wallabag-86719c63bf47686ca55020e6b0443344de36d45a.zip |
Merge pull request #1583 from wallabag/v2-fix-delete
Fix `findOneByUrl` side effect in tests
Diffstat (limited to 'src/Wallabag/ImportBundle')
4 files changed, 4 insertions, 4 deletions
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 | |||
214 | 214 | ||
215 | $existingEntry = $this->em | 215 | $existingEntry = $this->em |
216 | ->getRepository('WallabagCoreBundle:Entry') | 216 | ->getRepository('WallabagCoreBundle:Entry') |
217 | ->existByUrlAndUserId($url, $this->user->getId()); | 217 | ->findByUrlAndUserId($url, $this->user->getId()); |
218 | 218 | ||
219 | if (false !== $existingEntry) { | 219 | if (false !== $existingEntry) { |
220 | ++$this->skippedEntries; | 220 | ++$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 | |||
127 | foreach ($entries as $importedEntry) { | 127 | foreach ($entries as $importedEntry) { |
128 | $existingEntry = $this->em | 128 | $existingEntry = $this->em |
129 | ->getRepository('WallabagCoreBundle:Entry') | 129 | ->getRepository('WallabagCoreBundle:Entry') |
130 | ->existByUrlAndUserId($importedEntry['url'], $this->user->getId()); | 130 | ->findByUrlAndUserId($importedEntry['url'], $this->user->getId()); |
131 | 131 | ||
132 | if (false !== $existingEntry) { | 132 | if (false !== $existingEntry) { |
133 | ++$this->skippedEntries; | 133 | ++$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 | |||
248 | ->getMock(); | 248 | ->getMock(); |
249 | 249 | ||
250 | $entryRepo->expects($this->exactly(2)) | 250 | $entryRepo->expects($this->exactly(2)) |
251 | ->method('existByUrlAndUserId') | 251 | ->method('findByUrlAndUserId') |
252 | ->will($this->onConsecutiveCalls(false, true)); | 252 | ->will($this->onConsecutiveCalls(false, true)); |
253 | 253 | ||
254 | $tag = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Tag') | 254 | $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 | |||
53 | ->getMock(); | 53 | ->getMock(); |
54 | 54 | ||
55 | $entryRepo->expects($this->exactly(3)) | 55 | $entryRepo->expects($this->exactly(3)) |
56 | ->method('existByUrlAndUserId') | 56 | ->method('findByUrlAndUserId') |
57 | ->will($this->onConsecutiveCalls(false, true, false)); | 57 | ->will($this->onConsecutiveCalls(false, true, false)); |
58 | 58 | ||
59 | $this->em | 59 | $this->em |