Merge "Use User->isRegistered(), not deprecated isLoggedIn()"

This commit is contained in:
jenkins-bot 2020-12-19 17:06:44 +00:00 committed by Gerrit Code Review
commit c07310165a
4 changed files with 9 additions and 9 deletions

View File

@ -301,7 +301,7 @@ class Hooks {
$user = $out->getUser();
if ( $user->isLoggedIn() && self::isSkinVersionLegacy() ) {
if ( $user->isRegistered() && self::isSkinVersionLegacy() ) {
$vars[ 'wgVectorDisableSidebarPersistence' ] =
self::getConfig(
Constants::CONFIG_KEY_DISABLE_SIDEBAR_PERSISTENCE

View File

@ -134,7 +134,7 @@ class SkinVector extends SkinMustache {
'sidebar-visible' => $this->isSidebarVisible(),
], $this->getMenuProps() );
if ( $skin->getUser()->isLoggedIn() ) {
if ( $skin->getUser()->isRegistered() ) {
// Note: This data is also passed to legacy template where it is unused.
$commonSkinData['data-emphasized-sidebar-action'] = [
'href' => SpecialPage::getTitleFor(
@ -169,7 +169,7 @@ class SkinVector extends SkinMustache {
*/
private function isSidebarVisible() {
$skin = $this->getSkin();
if ( $skin->getUser()->isLoggedIn() ) {
if ( $skin->getUser()->isRegistered() ) {
$userPrefSidebarState = $skin->getUser()->getOption(
Constants::PREF_KEY_SIDEBAR_VISIBLE
);

View File

@ -109,7 +109,7 @@ final class SkinVersionLookup {
$this->user->getOption(
Constants::PREF_KEY_SKIN_VERSION,
$this->config->get(
$this->user->isLoggedIn()
$this->user->isRegistered()
? Constants::CONFIG_KEY_DEFAULT_SKIN_VERSION_FOR_EXISTING_ACCOUNTS
: Constants::CONFIG_KEY_DEFAULT_SKIN_VERSION
)

View File

@ -39,7 +39,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
$user = $this->createMock( \User::class );
$user
->method( 'isLoggedIn' )
->method( 'isRegistered' )
->willReturn( false );
$user
->method( 'getOption' )
@ -78,7 +78,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
$user = $this->createMock( \User::class );
$user
->method( 'isLoggedIn' )
->method( 'isRegistered' )
->willReturn( false );
$user
->method( 'getOption' )
@ -108,7 +108,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
* @covers ::getVersion
* @covers ::isLegacy
*/
public function testConfigLoggedIn() {
public function testConfigRegistered() {
$request = $this->getMockBuilder( \WebRequest::class )->getMock();
$request
->method( 'getVal' )
@ -117,7 +117,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
$user = $this->createMock( \User::class );
$user
->method( 'isLoggedIn' )
->method( 'isRegistered' )
->willReturn( true );
$user
->method( 'getOption' )
@ -156,7 +156,7 @@ class SkinVersionLookupTest extends \MediaWikiTestCase {
$user = $this->createMock( \User::class );
$user
->method( 'isLoggedIn' )
->method( 'isRegistered' )
->willReturn( false );
$user
->method( 'getOption' )