From c2656f96d4776c86b13d8a4c93a78ee7c4d3824c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 19 Feb 2016 14:22:20 +0100 Subject: Move assignTagsToEntry in ContentProxy helper --- .../ImportBundle/Tests/Import/PocketImportTest.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/Wallabag/ImportBundle/Tests/Import') diff --git a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php index 25359d56..f44786b1 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php @@ -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() -- cgit v1.2.3