X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FTests%2FImport%2FPocketImportTest.php;h=f44786b1a76d92dcc0293c3a18ffa62994bf4ddf;hb=c2656f96d4776c86b13d8a4c93a78ee7c4d3824c;hp=25359d56bb1b7d7db5c1bb6dec3012972d960b36;hpb=fa64d861105bd0713acd7ac5d116353273524b4f;p=github%2Fwallabag%2Fwallabag.git 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()