diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2016-02-11 16:47:58 +0100 |
---|---|---|
committer | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2016-02-11 16:47:58 +0100 |
commit | 6896ae1dda1e399ce39111b28f8f6fbc1d71e14f (patch) | |
tree | e0d68f956723c30c91411913f09f22c95fbddf7d /src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php | |
parent | 6e2ca4d8256f9e5b14c56e68cd0f0afadfcd28dd (diff) | |
parent | eaf9dad777e84d50e8b3e5877b05605ad9138fee (diff) | |
download | wallabag-6896ae1dda1e399ce39111b28f8f6fbc1d71e14f.tar.gz wallabag-6896ae1dda1e399ce39111b28f8f6fbc1d71e14f.tar.zst wallabag-6896ae1dda1e399ce39111b28f8f6fbc1d71e14f.zip |
Merge pull request #1666 from wallabag/v2-reimport-v1-articles-if-not-fetched
reimport v1 entries if they were not fetched
Diffstat (limited to 'src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php | 11 |
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() |