aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Tests/Import
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Tests/Import')
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php18
1 files changed, 2 insertions, 16 deletions
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
260 ->method('findByUrlAndUserId') 260 ->method('findByUrlAndUserId')
261 ->will($this->onConsecutiveCalls(false, true)); 261 ->will($this->onConsecutiveCalls(false, true));
262 262
263 $tag = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Tag')
264 ->disableOriginalConstructor()
265 ->getMock();
266
267 $tagRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\TagRepository')
268 ->disableOriginalConstructor()
269 ->getMock();
270
271 $tagRepo->expects($this->exactly(2))
272 // the method `findOneByLabel` doesn't exist, EntityRepository will then call `_call` method
273 // to magically call the `findOneBy` with ['label' => 'foo']
274 ->method('__call')
275 ->will($this->onConsecutiveCalls(false, $tag));
276
277 $this->em 263 $this->em
278 ->expects($this->any()) 264 ->expects($this->exactly(2))
279 ->method('getRepository') 265 ->method('getRepository')
280 ->will($this->onConsecutiveCalls($entryRepo, $tagRepo, $tagRepo, $entryRepo)); 266 ->willReturn($entryRepo);
281 267
282 $entry = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Entry') 268 $entry = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Entry')
283 ->disableOriginalConstructor() 269 ->disableOriginalConstructor()