public function testUncallableHandlersAreLogged()
{
$events = new \Elgg\EventsService();
$loggerMock = $this->getMock('\\Elgg\\Logger', array(), array(), '', false);
$events->setLogger($loggerMock);
$events->registerHandler('foo', 'bar', array(new \stdClass(), 'uncallableMethod'));
$expectedMsg = 'handler for event [foo, bar] is not callable: (stdClass)->uncallableMethod';
$loggerMock->expects($this->once())->method('warn')->with($expectedMsg);
$events->trigger('foo', 'bar');
}