public function testStoppingEnqueueEvent()
{
$mock = $this->getMock(PluginHooksService::class, ['trigger']);
$mock->expects($this->once())->method('trigger')->will($this->returnValue(false));
$this->hooks = $mock;
$this->setupServices();
$object = $this->getTestObject();
$this->session->setLoggedInUser($this->actor);
$this->notifications->registerEvent($object->getType(), $object->getSubtype());
$this->notifications->enqueueEvent('create', $object->getType(), $object);
$this->assertNull($this->queue->dequeue());
$this->session->removeLoggedInUser();
}