->with(json_decode($body, true))
->willReturn($entry);
+ $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $dispatcher
+ ->expects($this->once())
+ ->method('dispatch');
+
$consumer = new RedisEntryConsumer(
$em,
$userRepository,
- $import
+ $import,
+ $dispatcher
);
$res = $consumer->manage($body);
->disableOriginalConstructor()
->getMock();
+ $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $dispatcher
+ ->expects($this->never())
+ ->method('dispatch');
+
$consumer = new RedisEntryConsumer(
$em,
$userRepository,
- $import
+ $import,
+ $dispatcher
);
$res = $consumer->manage($body);
->with(json_decode($body, true))
->willReturn(null);
+ $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $dispatcher
+ ->expects($this->never())
+ ->method('dispatch');
+
$consumer = new RedisEntryConsumer(
$em,
$userRepository,
- $import
+ $import,
+ $dispatcher
);
$res = $consumer->manage($body);