aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php')
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
index 4ebe93bf..3268cd3e 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
@@ -12,6 +12,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
12 protected $user; 12 protected $user;
13 protected $em; 13 protected $em;
14 protected $logHandler; 14 protected $logHandler;
15 protected $contentProxy;
15 16
16 private function getWallabagV2Import($unsetUser = false) 17 private function getWallabagV2Import($unsetUser = false)
17 { 18 {
@@ -21,7 +22,11 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
21 ->disableOriginalConstructor() 22 ->disableOriginalConstructor()
22 ->getMock(); 23 ->getMock();
23 24
24 $wallabag = new WallabagV2Import($this->em); 25 $this->contentProxy = $this->getMockBuilder('Wallabag\CoreBundle\Helper\ContentProxy')
26 ->disableOriginalConstructor()
27 ->getMock();
28
29 $wallabag = new WallabagV2Import($this->em, $this->contentProxy);
25 30
26 $this->logHandler = new TestHandler(); 31 $this->logHandler = new TestHandler();
27 $logger = new Logger('test', array($this->logHandler)); 32 $logger = new Logger('test', array($this->logHandler));
@@ -52,7 +57,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
52 ->disableOriginalConstructor() 57 ->disableOriginalConstructor()
53 ->getMock(); 58 ->getMock();
54 59
55 $entryRepo->expects($this->exactly(2)) 60 $entryRepo->expects($this->exactly(3))
56 ->method('findByUrlAndUserId') 61 ->method('findByUrlAndUserId')
57 ->will($this->onConsecutiveCalls(false, true, false)); 62 ->will($this->onConsecutiveCalls(false, true, false));
58 63
@@ -64,7 +69,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
64 $res = $wallabagV2Import->import(); 69 $res = $wallabagV2Import->import();
65 70
66 $this->assertTrue($res); 71 $this->assertTrue($res);
67 $this->assertEquals(['skipped' => 1, 'imported' => 1], $wallabagV2Import->getSummary()); 72 $this->assertEquals(['skipped' => 1, 'imported' => 2], $wallabagV2Import->getSummary());
68 } 73 }
69 74
70 public function testImportBadFile() 75 public function testImportBadFile()