mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 14:23:53 +00:00
Merge "Revert "ServiceWiring: Avoid usage of deprecated Title::getSubjectPage()""
This commit is contained in:
commit
5e43bf1ef2
|
@ -84,11 +84,10 @@ return [
|
|||
$user = $context->getUser();
|
||||
$userPageHelper = $services->getService( 'Minerva.SkinUserPageHelper' );
|
||||
$languagesHelper = $services->getService( 'Minerva.LanguagesHelper' );
|
||||
$namespaceInfo = $services->getNamespaceInfo();
|
||||
|
||||
$relevantUserPageHelper = $title->inNamespace( NS_USER_TALK ) ?
|
||||
new SkinUserPageHelper(
|
||||
$namespaceInfo->getSubjectPage( $context->getSkin()->getRelevantTitle() )
|
||||
$context->getSkin()->getRelevantTitle()->getSubjectPage()
|
||||
) :
|
||||
$userPageHelper;
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
namespace MediaWiki\Minerva\Skins;
|
||||
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use Title;
|
||||
use User;
|
||||
|
||||
|
@ -40,9 +39,9 @@ class SkinUserPageHelper {
|
|||
private $pageUser;
|
||||
|
||||
/**
|
||||
* @param Title|LinkTarget|null $title
|
||||
* @param Title|null $title
|
||||
*/
|
||||
public function __construct( $title = null ) {
|
||||
public function __construct( Title $title = null ) {
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Tests\MediaWiki\Minerva;
|
||||
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use MediaWiki\Minerva\Skins\SkinUserPageHelper;
|
||||
use MediaWikiTestCase;
|
||||
use Title;
|
||||
|
@ -25,20 +24,6 @@ class SkinUserPageHelperTest extends MediaWikiTestCase {
|
|||
$this->assertFalse( $helper->isUserPage() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::isUserPage
|
||||
* @covers ::getPageUser
|
||||
*/
|
||||
public function testLinkTargetAsConsumer() {
|
||||
$linkTarget = $this->createMock( LinkTarget::class );
|
||||
$linkTarget->method( 'getText' )
|
||||
->willReturn( 'User:LinkTarget' );
|
||||
|
||||
$helper = new SkinUserPageHelper( $linkTarget );
|
||||
$this->assertNull( $helper->getPageUser() );
|
||||
$this->assertFalse( $helper->isUserPage() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::isUserPage
|
||||
* @covers ::fetchData
|
||||
|
|
Loading…
Reference in a new issue