mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-27 17:28:39 +00:00
Move assignTagsToEntry in ContentProxy helper
This commit is contained in:
parent
fa64d86110
commit
c2656f96d4
7 changed files with 158 additions and 92 deletions
|
@ -260,24 +260,10 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
|
|||
->method('findByUrlAndUserId')
|
||||
->will($this->onConsecutiveCalls(false, true));
|
||||
|
||||
$tag = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Tag')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$tagRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\TagRepository')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$tagRepo->expects($this->exactly(2))
|
||||
// the method `findOneByLabel` doesn't exist, EntityRepository will then call `_call` method
|
||||
// to magically call the `findOneBy` with ['label' => 'foo']
|
||||
->method('__call')
|
||||
->will($this->onConsecutiveCalls(false, $tag));
|
||||
|
||||
$this->em
|
||||
->expects($this->any())
|
||||
->expects($this->exactly(2))
|
||||
->method('getRepository')
|
||||
->will($this->onConsecutiveCalls($entryRepo, $tagRepo, $tagRepo, $entryRepo));
|
||||
->willReturn($entryRepo);
|
||||
|
||||
$entry = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Entry')
|
||||
->disableOriginalConstructor()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue