diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-25 11:26:15 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-25 12:03:49 +0200 |
commit | 401135852c6b25c8d5ab97beaefb02d1bd023ec9 (patch) | |
tree | 5922f4bd40af0ceb61db2c55755bc006f18410fb /tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php | |
parent | faa86e06ba3032fdb98f3c0f79c72e8581d3c96f (diff) | |
download | wallabag-401135852c6b25c8d5ab97beaefb02d1bd023ec9.tar.gz wallabag-401135852c6b25c8d5ab97beaefb02d1bd023ec9.tar.zst wallabag-401135852c6b25c8d5ab97beaefb02d1bd023ec9.zip |
Use scheduled entity insertions to avoid tag duplicate
Using `getScheduledEntityInsertions()` we can retrieve not yet flushed but already persisted entities and then avoid tags duplication on import.
Diffstat (limited to 'tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php')
-rw-r--r-- | tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php b/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php index 5ab4ad00..82dc4c7e 100644 --- a/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php | |||
@@ -26,6 +26,20 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase | |||
26 | ->disableOriginalConstructor() | 26 | ->disableOriginalConstructor() |
27 | ->getMock(); | 27 | ->getMock(); |
28 | 28 | ||
29 | $this->uow = $this->getMockBuilder('Doctrine\ORM\UnitOfWork') | ||
30 | ->disableOriginalConstructor() | ||
31 | ->getMock(); | ||
32 | |||
33 | $this->em | ||
34 | ->expects($this->any()) | ||
35 | ->method('getUnitOfWork') | ||
36 | ->willReturn($this->uow); | ||
37 | |||
38 | $this->uow | ||
39 | ->expects($this->any()) | ||
40 | ->method('getScheduledEntityInsertions') | ||
41 | ->willReturn([]); | ||
42 | |||
29 | $this->contentProxy = $this->getMockBuilder('Wallabag\CoreBundle\Helper\ContentProxy') | 43 | $this->contentProxy = $this->getMockBuilder('Wallabag\CoreBundle\Helper\ContentProxy') |
30 | ->disableOriginalConstructor() | 44 | ->disableOriginalConstructor() |
31 | ->getMock(); | 45 | ->getMock(); |