diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-09 18:02:29 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-11 21:58:56 +0200 |
commit | 13470c3596d0b1490bbf18b39128a05bbb3c7f3e (patch) | |
tree | 962028a191b644653e6c9b2b536189ded89c3017 /tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php | |
parent | 8664069e1aa2fa89e17587308a03f2720c20327a (diff) | |
download | wallabag-13470c3596d0b1490bbf18b39128a05bbb3c7f3e.tar.gz wallabag-13470c3596d0b1490bbf18b39128a05bbb3c7f3e.tar.zst wallabag-13470c3596d0b1490bbf18b39128a05bbb3c7f3e.zip |
Add test for RabbitMQ
Also update Symfony deps
Diffstat (limited to 'tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php')
-rw-r--r-- | tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php index 4a45e0f0..51f0aada 100644 --- a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php | |||
@@ -116,6 +116,42 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase | |||
116 | $this->assertEquals(['skipped' => 0, 'imported' => 2], $wallabagV2Import->getSummary()); | 116 | $this->assertEquals(['skipped' => 0, 'imported' => 2], $wallabagV2Import->getSummary()); |
117 | } | 117 | } |
118 | 118 | ||
119 | public function testImportWithRabbit() | ||
120 | { | ||
121 | $wallabagV2Import = $this->getWallabagV2Import(); | ||
122 | $wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2.json'); | ||
123 | |||
124 | $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') | ||
125 | ->disableOriginalConstructor() | ||
126 | ->getMock(); | ||
127 | |||
128 | $entryRepo->expects($this->never()) | ||
129 | ->method('findByUrlAndUserId'); | ||
130 | |||
131 | $this->em | ||
132 | ->expects($this->never()) | ||
133 | ->method('getRepository'); | ||
134 | |||
135 | $this->contentProxy | ||
136 | ->expects($this->never()) | ||
137 | ->method('updateEntry'); | ||
138 | |||
139 | $producer = $this->getMockBuilder('OldSound\RabbitMqBundle\RabbitMq\Producer') | ||
140 | ->disableOriginalConstructor() | ||
141 | ->getMock(); | ||
142 | |||
143 | $producer | ||
144 | ->expects($this->exactly(24)) | ||
145 | ->method('publish'); | ||
146 | |||
147 | $wallabagV2Import->setRabbitmqProducer($producer); | ||
148 | |||
149 | $res = $wallabagV2Import->setMarkAsRead(true)->import(); | ||
150 | |||
151 | $this->assertTrue($res); | ||
152 | $this->assertEquals(['skipped' => 0, 'imported' => 24], $wallabagV2Import->getSummary()); | ||
153 | } | ||
154 | |||
119 | public function testImportBadFile() | 155 | public function testImportBadFile() |
120 | { | 156 | { |
121 | $wallabagV1Import = $this->getWallabagV2Import(); | 157 | $wallabagV1Import = $this->getWallabagV2Import(); |