* @throws \Exception
*/
public function testModifyQuery() {
- $listener = function(\Civi\Core\Event\GenericHookEvent $e) {
+ $listener = function(\Symfony\Component\EventDispatcher\Event $e) {
$e->query = '/* User : hooked */' . $e->query;
};
Civi::dispatcher()->addListener('civi.db.query', $listener);
* Demonstrate it is modified showing the query now breaks.
*/
public function testModifyAndBreakQuery() {
- $listener = function(\Civi\Core\Event\GenericHookEvent $e) {
+ $listener = function($e) {
$e->query = '/* Forgot trailing comment marker' . $e->query;
};
Civi::dispatcher()->addListener('civi.db.query', $listener);
CRM_Utils_System::flushCache();
// initialize the object once db is loaded
- \Civi::reset();
+ \Civi::$statics = array();
// ugh, performance
$config = CRM_Core_Config::singleton(TRUE, TRUE);