Add entry.saved event to import & rest

This commit is contained in:
Jeremy Benoist
2016-11-02 07:10:23 +01:00
parent e0597476d1
commit 7816eb622d
17 changed files with 222 additions and 49 deletions

View File

@ -111,10 +111,19 @@ JSON;
->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);
@ -156,10 +165,19 @@ JSON;
->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);
@ -211,10 +229,19 @@ JSON;
->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);