aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/ImportBundle/Import/ChromeImportTest.php')
-rw-r--r--tests/Wallabag/ImportBundle/Import/ChromeImportTest.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php b/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php
index 1e52615c..6b3adda4 100644
--- a/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php
+++ b/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php
@@ -18,7 +18,7 @@ class ChromeImportTest extends \PHPUnit_Framework_TestCase
18 protected $logHandler; 18 protected $logHandler;
19 protected $contentProxy; 19 protected $contentProxy;
20 20
21 private function getChromeImport($unsetUser = false) 21 private function getChromeImport($unsetUser = false, $dispatched = 0)
22 { 22 {
23 $this->user = new User(); 23 $this->user = new User();
24 24
@@ -30,7 +30,15 @@ class ChromeImportTest extends \PHPUnit_Framework_TestCase
30 ->disableOriginalConstructor() 30 ->disableOriginalConstructor()
31 ->getMock(); 31 ->getMock();
32 32
33 $wallabag = new ChromeImport($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 $wallabag = new ChromeImport($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 ChromeImportTest extends \PHPUnit_Framework_TestCase
54 62
55 public function testImport() 63 public function testImport()
56 { 64 {
57 $chromeImport = $this->getChromeImport(); 65 $chromeImport = $this->getChromeImport(false, 1);
58 $chromeImport->setFilepath(__DIR__.'/../fixtures/chrome-bookmarks'); 66 $chromeImport->setFilepath(__DIR__.'/../fixtures/chrome-bookmarks');
59 67
60 $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') 68 $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
@@ -87,7 +95,7 @@ class ChromeImportTest extends \PHPUnit_Framework_TestCase
87 95
88 public function testImportAndMarkAllAsRead() 96 public function testImportAndMarkAllAsRead()
89 { 97 {
90 $chromeImport = $this->getChromeImport(); 98 $chromeImport = $this->getChromeImport(false, 1);
91 $chromeImport->setFilepath(__DIR__.'/../fixtures/chrome-bookmarks'); 99 $chromeImport->setFilepath(__DIR__.'/../fixtures/chrome-bookmarks');
92 100
93 $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') 101 $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')