mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 09:49:31 +02:00
Fix tests.
This commit is contained in:
@ -71,7 +71,8 @@ class ExtensionTest extends LinkTitles\TestCase {
|
|||||||
] );
|
] );
|
||||||
$title = $this->insertPage( 'test page', $input )['title'];
|
$title = $this->insertPage( 'test page', $input )['title'];
|
||||||
$page = new WikiPage( $title );
|
$page = new WikiPage( $title );
|
||||||
$output = $page->getParserOutput( new ParserOptions(), null, true );
|
$user = MediaWiki\User\UserFactory::newAnonymous();
|
||||||
|
$output = $page->getParserOutput( new ParserOptions( $user ), null, true );
|
||||||
$lines = explode( "\n", $output->getText() );
|
$lines = explode( "\n", $output->getText() );
|
||||||
$this->assertRegexp( $expectedOutput, $lines[0] );
|
$this->assertRegexp( $expectedOutput, $lines[0] );
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ class LinkTitlesLinkerTest extends LinkTitles\TestCase {
|
|||||||
// Reset namespace caches.
|
// Reset namespace caches.
|
||||||
// See https://stackoverflow.com/q/45974979/270712
|
// See https://stackoverflow.com/q/45974979/270712
|
||||||
\MWNamespace::getCanonicalNamespaces(true);
|
\MWNamespace::getCanonicalNamespaces(true);
|
||||||
global $wgContLang;
|
$wgContLang = \MediaWiki\MediaWikiServices::getInstance()->getContentLanguage();
|
||||||
$wgContLang->resetNamespaces();
|
$wgContLang->resetNamespaces();
|
||||||
$this->assertTrue( MWNamespace::exists( $ns ), "The namespace with id $ns should exist!" );
|
$this->assertTrue( MWNamespace::exists( $ns ), "The namespace with id $ns should exist!" );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user