addListener('core.test_event', function (\phpbb\event\data $event) { $event['foo'] = $event['foo'] . '2'; $event['bar'] = $event['bar'] . '2'; }); $foo = 'foo'; $bar = 'bar'; $vars = array('foo', 'bar'); $result = $dispatcher->trigger_event('core.test_event', compact($vars)); $this->assertSame(array('foo' => 'foo2', 'bar' => 'bar2'), $result); } }