Updated to work with new MediaWiki\Title\Title in 1.44

This commit is contained in:
2025-07-10 12:51:00 +02:00
parent 15f8fc5a3b
commit c56a6850a2
13 changed files with 56 additions and 32 deletions

View File

@ -35,6 +35,9 @@
* @group bovender
* @group Database
*/
use MediaWiki\MediaWikiServices;
class LinkTitlesLinkerTest extends LinkTitles\TestCase {
protected $title;
@ -317,10 +320,11 @@ class LinkTitlesLinkerTest extends LinkTitles\TestCase {
// Reset namespace caches.
// See https://stackoverflow.com/q/45974979/270712
\MWNamespace::getCanonicalNamespaces(true);
$namespaceInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
$namespaceInfo->getCanonicalNamespaces( true );
$wgContLang = \MediaWiki\MediaWikiServices::getInstance()->getContentLanguage();
$wgContLang->resetNamespaces();
$this->assertTrue( MWNamespace::exists( $ns ), "The namespace with id $ns should exist!" );
$this->assertTrue( $namespaceInfo->exists( $ns ), "The namespace with id $ns should exist!" );
$this->insertPage( "in custom namespace", 'This is a page in a custom namespace', $ns );
LinkTitles\Targets::invalidate();