diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2016-11-03 16:22:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-03 16:22:07 +0100 |
commit | da4136557963018287cae61226e9006c3c741747 (patch) | |
tree | 6bf23c0d32f3780843798ae47c65377ae1ff961a /tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php | |
parent | 816c0940d142f8ec69bdd3f302c9751033cce7e2 (diff) | |
parent | ca08d02f2f17c0e4ec0152a701c540f62713a428 (diff) | |
download | wallabag-da4136557963018287cae61226e9006c3c741747.tar.gz wallabag-da4136557963018287cae61226e9006c3c741747.tar.zst wallabag-da4136557963018287cae61226e9006c3c741747.zip |
Merge pull request #2180 from wallabag/download-pictures
Download pictures
Diffstat (limited to 'tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php')
-rw-r--r-- | tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php b/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php index 75900bd7..e262a808 100644 --- a/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php | |||
@@ -18,7 +18,7 @@ class InstapaperImportTest extends \PHPUnit_Framework_TestCase | |||
18 | protected $logHandler; | 18 | protected $logHandler; |
19 | protected $contentProxy; | 19 | protected $contentProxy; |
20 | 20 | ||
21 | private function getInstapaperImport($unsetUser = false) | 21 | private function getInstapaperImport($unsetUser = false, $dispatched = 0) |
22 | { | 22 | { |
23 | $this->user = new User(); | 23 | $this->user = new User(); |
24 | 24 | ||
@@ -30,7 +30,15 @@ class InstapaperImportTest extends \PHPUnit_Framework_TestCase | |||
30 | ->disableOriginalConstructor() | 30 | ->disableOriginalConstructor() |
31 | ->getMock(); | 31 | ->getMock(); |
32 | 32 | ||
33 | $import = new InstapaperImport($this->em, $this->contentProxy); | 33 | $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') |
34 | ->disableOriginalConstructor() | ||
35 | ->getMock(); | ||
36 | |||
37 | $dispatcher | ||
38 | ->expects($this->exactly($dispatched)) | ||
39 | ->method('dispatch'); | ||
40 | |||
41 | $import = new InstapaperImport($this->em, $this->contentProxy, $dispatcher); | ||
34 | 42 | ||
35 | $this->logHandler = new TestHandler(); | 43 | $this->logHandler = new TestHandler(); |
36 | $logger = new Logger('test', [$this->logHandler]); | 44 | $logger = new Logger('test', [$this->logHandler]); |
@@ -54,7 +62,7 @@ class InstapaperImportTest extends \PHPUnit_Framework_TestCase | |||
54 | 62 | ||
55 | public function testImport() | 63 | public function testImport() |
56 | { | 64 | { |
57 | $instapaperImport = $this->getInstapaperImport(); | 65 | $instapaperImport = $this->getInstapaperImport(false, 3); |
58 | $instapaperImport->setFilepath(__DIR__.'/../fixtures/instapaper-export.csv'); | 66 | $instapaperImport->setFilepath(__DIR__.'/../fixtures/instapaper-export.csv'); |
59 | 67 | ||
60 | $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') | 68 | $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') |
@@ -87,7 +95,7 @@ class InstapaperImportTest extends \PHPUnit_Framework_TestCase | |||
87 | 95 | ||
88 | public function testImportAndMarkAllAsRead() | 96 | public function testImportAndMarkAllAsRead() |
89 | { | 97 | { |
90 | $instapaperImport = $this->getInstapaperImport(); | 98 | $instapaperImport = $this->getInstapaperImport(false, 1); |
91 | $instapaperImport->setFilepath(__DIR__.'/../fixtures/instapaper-export.csv'); | 99 | $instapaperImport->setFilepath(__DIR__.'/../fixtures/instapaper-export.csv'); |
92 | 100 | ||
93 | $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') | 101 | $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') |