}
/**
- * Function to call all event handlers when triggering an event
- *
* @deprecated since 2.6
- *
- * @param string $eventname name of the event
- * @param mixed $eventdata event data object
- * @return int number of failed events
*/
function events_trigger($eventname, $eventdata) {
- debugging('events_trigger() is deprecated, please use new events instead', DEBUG_DEVELOPER);
- return events_trigger_legacy($eventname, $eventdata);
+ throw new coding_exception('events_trigger() can not be used any more.'.
+ ' Please use new events instead.');
}
/**
}
/**
- * Tests events_trigger() function.
+ * Tests that events_trigger throws an exception.
*/
- public function test_events_trigger_debugging() {
-
- events_update_definition('unittest');
- $this->assertDebuggingCalled(self::DEBUGGING_MSG, DEBUG_DEVELOPER);
-
- $this->assertEquals(0, events_trigger('test_instant', 'ok'));
- $debugmessages = array('events_trigger() is deprecated, please use new events instead', self::DEBUGGING_MSG);
- $this->assertDebuggingCalledCount(2, $debugmessages, array(DEBUG_DEVELOPER, DEBUG_DEVELOPER));
+ public function test_events_trigger_exception() {
+ $this->expectException('coding_exception');
+ events_trigger('test_instant', 'ok');
}
}
example, to inform the user that there are too many items matching the current search criteria.
* The following functions have been finally deprecated and can not be used any more:
- external_function_info()
+ - events_trigger()
* Following api's have been removed in behat_config_manager, please use behat_config_util instead.
- get_features_with_tags()
- get_components_steps_definitions()