diff options
Diffstat (limited to 'tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php')
-rw-r--r-- | tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php b/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php index 82dc4c7e..4dbced60 100644 --- a/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php | |||
@@ -18,7 +18,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase | |||
18 | protected $logHandler; | 18 | protected $logHandler; |
19 | protected $contentProxy; | 19 | protected $contentProxy; |
20 | 20 | ||
21 | private function getWallabagV1Import($unsetUser = false) | 21 | private function getWallabagV1Import($unsetUser = false, $dispatched = 0) |
22 | { | 22 | { |
23 | $this->user = new User(); | 23 | $this->user = new User(); |
24 | 24 | ||
@@ -44,7 +44,15 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase | |||
44 | ->disableOriginalConstructor() | 44 | ->disableOriginalConstructor() |
45 | ->getMock(); | 45 | ->getMock(); |
46 | 46 | ||
47 | $wallabag = new WallabagV1Import($this->em, $this->contentProxy); | 47 | $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') |
48 | ->disableOriginalConstructor() | ||
49 | ->getMock(); | ||
50 | |||
51 | $dispatcher | ||
52 | ->expects($this->exactly($dispatched)) | ||
53 | ->method('dispatch'); | ||
54 | |||
55 | $wallabag = new WallabagV1Import($this->em, $this->contentProxy, $dispatcher); | ||
48 | 56 | ||
49 | $this->logHandler = new TestHandler(); | 57 | $this->logHandler = new TestHandler(); |
50 | $logger = new Logger('test', [$this->logHandler]); | 58 | $logger = new Logger('test', [$this->logHandler]); |
@@ -68,7 +76,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase | |||
68 | 76 | ||
69 | public function testImport() | 77 | public function testImport() |
70 | { | 78 | { |
71 | $wallabagV1Import = $this->getWallabagV1Import(); | 79 | $wallabagV1Import = $this->getWallabagV1Import(false, 3); |
72 | $wallabagV1Import->setFilepath(__DIR__.'/../fixtures/wallabag-v1.json'); | 80 | $wallabagV1Import->setFilepath(__DIR__.'/../fixtures/wallabag-v1.json'); |
73 | 81 | ||
74 | $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') | 82 | $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') |
@@ -101,7 +109,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase | |||
101 | 109 | ||
102 | public function testImportAndMarkAllAsRead() | 110 | public function testImportAndMarkAllAsRead() |
103 | { | 111 | { |
104 | $wallabagV1Import = $this->getWallabagV1Import(); | 112 | $wallabagV1Import = $this->getWallabagV1Import(false, 3); |
105 | $wallabagV1Import->setFilepath(__DIR__.'/../fixtures/wallabag-v1-read.json'); | 113 | $wallabagV1Import->setFilepath(__DIR__.'/../fixtures/wallabag-v1-read.json'); |
106 | 114 | ||
107 | $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') | 115 | $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') |