Ejemplo n.º 1
0
 public function testOnOutputPageParserOutput()
 {
     $altLinks = array(array('a' => 'b'), array('c', 'd'));
     $context = new DerivativeContext(RequestContext::getMain());
     $out = new OutputPage($context);
     $parserOutput = $this->getMock('ParserOutput');
     $parserOutput->expects($this->exactly(3))->method('getExtensionData')->will($this->returnCallback(function ($key) use($altLinks) {
         if ($key === 'wikibase-alternate-links') {
             return $altLinks;
         } else {
             return $key;
         }
     }));
     RepoHooks::onOutputPageParserOutput($out, $parserOutput);
     $this->assertSame('wikibase-view-chunks', $out->getProperty('wikibase-view-chunks'));
     $this->assertSame('wikibase-titletext', $out->getProperty('wikibase-titletext'));
     $this->assertSame($altLinks, $out->getLinkTags());
 }