private function registerParserHookHandler() { $self = $this; $this->globals['wgHooks']['ParserFirstCallInit'][] = function (\Parser &$parser) use($self) { $hookRegistrant = new HookRegistrant($parser); $hookRegistrant->registerFunction(new FunctionRunner($self->getGitHubHookDefinition(), $self->getGitHubHookHandler(), array(FunctionRunner::OPT_DO_PARSE => false))); return true; }; }
/** * @dataProvider namesProvider */ public function testRegisterFunction(array $names) { $parser = $this->newMockParserForFunction($names); $registrant = new HookRegistrant($parser); $registrant->registerFunction($this->newMockRunner($names, 'ParserHooks\\FunctionRunner')); }