diff options
Diffstat (limited to 'tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php')
-rw-r--r-- | tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php b/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php index a3263771..856954a6 100644 --- a/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php +++ b/tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php | |||
@@ -112,10 +112,19 @@ JSON; | |||
112 | ->with(json_decode($body, true)) | 112 | ->with(json_decode($body, true)) |
113 | ->willReturn($entry); | 113 | ->willReturn($entry); |
114 | 114 | ||
115 | $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') | ||
116 | ->disableOriginalConstructor() | ||
117 | ->getMock(); | ||
118 | |||
119 | $dispatcher | ||
120 | ->expects($this->once()) | ||
121 | ->method('dispatch'); | ||
122 | |||
115 | $consumer = new AMQPEntryConsumer( | 123 | $consumer = new AMQPEntryConsumer( |
116 | $em, | 124 | $em, |
117 | $userRepository, | 125 | $userRepository, |
118 | $import | 126 | $import, |
127 | $dispatcher | ||
119 | ); | 128 | ); |
120 | 129 | ||
121 | $message = new AMQPMessage($body); | 130 | $message = new AMQPMessage($body); |
@@ -157,10 +166,19 @@ JSON; | |||
157 | ->disableOriginalConstructor() | 166 | ->disableOriginalConstructor() |
158 | ->getMock(); | 167 | ->getMock(); |
159 | 168 | ||
169 | $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') | ||
170 | ->disableOriginalConstructor() | ||
171 | ->getMock(); | ||
172 | |||
173 | $dispatcher | ||
174 | ->expects($this->never()) | ||
175 | ->method('dispatch'); | ||
176 | |||
160 | $consumer = new AMQPEntryConsumer( | 177 | $consumer = new AMQPEntryConsumer( |
161 | $em, | 178 | $em, |
162 | $userRepository, | 179 | $userRepository, |
163 | $import | 180 | $import, |
181 | $dispatcher | ||
164 | ); | 182 | ); |
165 | 183 | ||
166 | $message = new AMQPMessage($body); | 184 | $message = new AMQPMessage($body); |
@@ -212,10 +230,19 @@ JSON; | |||
212 | ->with(json_decode($body, true)) | 230 | ->with(json_decode($body, true)) |
213 | ->willReturn(null); | 231 | ->willReturn(null); |
214 | 232 | ||
233 | $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') | ||
234 | ->disableOriginalConstructor() | ||
235 | ->getMock(); | ||
236 | |||
237 | $dispatcher | ||
238 | ->expects($this->never()) | ||
239 | ->method('dispatch'); | ||
240 | |||
215 | $consumer = new AMQPEntryConsumer( | 241 | $consumer = new AMQPEntryConsumer( |
216 | $em, | 242 | $em, |
217 | $userRepository, | 243 | $userRepository, |
218 | $import | 244 | $import, |
245 | $dispatcher | ||
219 | ); | 246 | ); |
220 | 247 | ||
221 | $message = new AMQPMessage($body); | 248 | $message = new AMQPMessage($body); |