public function testEnqueueEvent()
{
$this->setupServices();
$object = $this->getTestObject();
$this->session->setLoggedInUser($this->actor);
$this->notifications->registerEvent($object->getType(), $object->getSubtype());
$this->notifications->enqueueEvent('create', $object->getType(), $object);
$event = new SubscriptionNotificationEvent($object, 'create');
$this->assertEquals($event, $this->queue->dequeue());
$this->assertNull($this->queue->dequeue());
// unregistered action type
$this->notifications->enqueueEvent('null', $object->getType(), $object);
$this->assertNull($this->queue->dequeue());
// unregistered object type
$this->notifications->enqueueEvent('create', $object->getType(), new ElggObject());
$this->assertNull($this->queue->dequeue());
$this->session->removeLoggedInUser();
}