public function testHandle()
 {
     $instance = new DocumentationParserFunction();
     $parser = $this->getMockBuilder('\\Parser')->disableOriginalConstructor()->getMock();
     $processedParam = $this->getMockBuilder('\\ParamProcessor\\ProcessedParam')->disableOriginalConstructor()->getMock();
     $processingResult = $this->getMockBuilder('\\ParamProcessor\\ProcessingResult')->disableOriginalConstructor()->getMock();
     $processingResult->expects($this->any())->method('getParameters')->will($this->returnValue(array('language' => $processedParam, 'format' => $processedParam, 'parameters' => $processedParam)));
     $this->assertInternalType('string', $instance->handle($parser, $processingResult));
 }
 private function registerParserFunctionHooks(ApplicationFactory $applicationFactory)
 {
     /**
      * @see https://www.mediawiki.org/wiki/Manual:Hooks/ParserFirstCallInit
      */
     $this->handlers['ParserFirstCallInit'] = function (&$parser) use($applicationFactory) {
         $parserFunctionFactory = $applicationFactory->newParserFunctionFactory($parser);
         list($name, $definition, $flag) = $parserFunctionFactory->newAskParserFunctionDefinition();
         $parser->setFunctionHook($name, $definition, $flag);
         list($name, $definition, $flag) = $parserFunctionFactory->newShowParserFunctionDefinition();
         $parser->setFunctionHook($name, $definition, $flag);
         list($name, $definition, $flag) = $parserFunctionFactory->newSubobjectParserFunctionDefinition();
         $parser->setFunctionHook($name, $definition, $flag);
         list($name, $definition, $flag) = $parserFunctionFactory->newRecurringEventsParserFunctionDefinition();
         $parser->setFunctionHook($name, $definition, $flag);
         list($name, $definition, $flag) = $parserFunctionFactory->newSetParserFunctionDefinition();
         $parser->setFunctionHook($name, $definition, $flag);
         list($name, $definition, $flag) = $parserFunctionFactory->newConceptParserFunctionDefinition();
         $parser->setFunctionHook($name, $definition, $flag);
         list($name, $definition, $flag) = $parserFunctionFactory->newDeclareParserFunctionDefinition();
         $parser->setFunctionHook($name, $definition, $flag);
         $hookRegistrant = new HookRegistrant($parser);
         $infoFunctionDefinition = InfoParserFunction::getHookDefinition();
         $infoFunctionHandler = new InfoParserFunction();
         $hookRegistrant->registerFunctionHandler($infoFunctionDefinition, $infoFunctionHandler);
         $hookRegistrant->registerHookHandler($infoFunctionDefinition, $infoFunctionHandler);
         $docsFunctionDefinition = DocumentationParserFunction::getHookDefinition();
         $docsFunctionHandler = new DocumentationParserFunction();
         $hookRegistrant->registerFunctionHandler($docsFunctionDefinition, $docsFunctionHandler);
         $hookRegistrant->registerHookHandler($docsFunctionDefinition, $docsFunctionHandler);
         return true;
     };
 }