// Query added
$this->assertEquals(
- '<a href="/w/index.php?title=Foobar&foo=bar" ' . 'title="Foobar">Foobar</a>',
+ '<a href="/w/index.php?title=Foobar&foo=bar" title="Foobar">Foobar</a>',
$linkRenderer->makeKnownLink( $target, null, [], [ 'foo' => 'bar' ] )
);
- // forcearticlepath
$linkRenderer->setForceArticlePath( true );
$this->assertEquals(
'<a href="/wiki/Foobar?foo=bar" title="Foobar">Foobar</a>',
}
public function testGetLinkClasses() {
- $wanCache = ObjectCache::getMainWANInstance();
- $titleFormatter = MediaWikiServices::getInstance()->getTitleFormatter();
- $linkCache = new LinkCache( $titleFormatter, $wanCache );
+ $services = MediaWikiServices::getInstance();
+ $wanCache = $services->getMainWANObjectCache();
+ $titleFormatter = $services->getTitleFormatter();
+ $nsInfo = $services->getNamespaceInfo();
+ $linkCache = new LinkCache( $titleFormatter, $wanCache, $nsInfo );
$foobarTitle = new TitleValue( NS_MAIN, 'FooBar' );
$redirectTitle = new TitleValue( NS_MAIN, 'Redirect' );
$userTitle = new TitleValue( NS_USER, 'Someuser' );
0 // redir
);
- $linkRenderer = new LinkRenderer( $titleFormatter, $linkCache );
+ $linkRenderer = new LinkRenderer( $titleFormatter, $linkCache, $nsInfo );
$linkRenderer->setStubThreshold( 0 );
$this->assertEquals(
'',