コード例 #1
0
ファイル: Setup.php プロジェクト: BrotherPhil/GitHub
 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;
     };
 }
コード例 #2
0
 /**
  * @dataProvider namesProvider
  */
 public function testRegisterFunction(array $names)
 {
     $parser = $this->newMockParserForFunction($names);
     $registrant = new HookRegistrant($parser);
     $registrant->registerFunction($this->newMockRunner($names, 'ParserHooks\\FunctionRunner'));
 }