forked from wallabag/wallabag
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.
This commit is contained in:
@ -41,6 +41,20 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->uow = $this->getMockBuilder('Doctrine\ORM\UnitOfWork')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->em
|
||||
->expects($this->any())
|
||||
->method('getUnitOfWork')
|
||||
->willReturn($this->uow);
|
||||
|
||||
$this->uow
|
||||
->expects($this->any())
|
||||
->method('getScheduledEntityInsertions')
|
||||
->willReturn([]);
|
||||
|
||||
$pocket = new PocketImport(
|
||||
$this->em,
|
||||
$this->contentProxy
|
||||
|
||||
Reference in New Issue
Block a user