MinervaNeue
A responsive mobile first skin
Loading...
Searching...
No Matches
MediaWiki\Minerva\MinervaPagePermissionsTest Class Reference

@group MinervaNeue @coversDefaultClass \MediaWiki\Minerva\Permissions\MinervaPagePermissions More...

+ Inheritance diagram for MediaWiki\Minerva\MinervaPagePermissionsTest:
+ Collaboration diagram for MediaWiki\Minerva\MinervaPagePermissionsTest:

Public Member Functions

 testWatchAndEditNotAllowedOnMainPage ()
 @covers ::isAllowed
 
 testInvalidPageActionsArentAllowed ()
 @covers ::isAllowed
 
 testValidPageActionsAreAllowed ()
 @covers ::isAllowed
 
 testEditPageAction ( $supportsDirectEditing, $supportsDirectApiEditing, $expected)
 The "edit" page action is allowed when the page doesn't support direct editing via the API.
 
 testPageActionsWhenOnUserPage ()
 @covers ::isAllowed
 
 testPageActionsWhenOnAnonUserPage ()
 @covers ::isAllowed
 
 testGlobalHideLanguageLinksTakesPrecedenceOnMainPage ()
 MediaWiki defines wgHideInterlanguageLinks which is default set to false, but some wikis can set this config to true.
 
 testGlobalHideLanguageLinksTakesPrecedence ()
 MediaWiki defines wgHideInterlanguageLinks which is default set to false, but some wikis can set this config to true.
 
 testSwitchLanguagePageAction ( $hasLanguagesOrVariants, $minervaAlwaysShowLanguageButton, $expected)
 The "switch-language" page action is allowed when: v2 of the page action bar is enabled and if the page has interlanguage links or if the $wgMinervaAlwaysShowLanguageButton configuration variable is set to truthy.
 
 testWatchIsAllowedOnlyWhenWatchlistPermissionsAreGranted ()
 Watch action requires 'viewmywatchlist' and 'editmywatchlist' permissions to be grated.
 
 testCannotWatchNotWatchableTitle ()
 If Title is not watchable, it cannot be watched @covers ::isAllowed.
 
 testMoveAndDeleteAndProtectNotAllowedByDefault ()
 @covers ::isAllowed
 
 testMoveAndDeleteAndProtectAllowedForUserWithPermissions ()
 @covers ::isAllowed
 

Static Public Member Functions

static editPageActionProvider ()
 
static switchLanguagePageActionProvider ()
 

Protected Member Functions

 setUp ()
 

Detailed Description

@group MinervaNeue @coversDefaultClass \MediaWiki\Minerva\Permissions\MinervaPagePermissions

Member Function Documentation

◆ testEditPageAction()

MediaWiki\Minerva\MinervaPagePermissionsTest::testEditPageAction ( $supportsDirectEditing,
$supportsDirectApiEditing,
$expected )

The "edit" page action is allowed when the page doesn't support direct editing via the API.

@dataProvider editPageActionProvider @covers ::isAllowed

◆ testGlobalHideLanguageLinksTakesPrecedence()

MediaWiki\Minerva\MinervaPagePermissionsTest::testGlobalHideLanguageLinksTakesPrecedence ( )

MediaWiki defines wgHideInterlanguageLinks which is default set to false, but some wikis can set this config to true.

Minerva page permissions must respect that @covers ::isAllowed

◆ testGlobalHideLanguageLinksTakesPrecedenceOnMainPage()

MediaWiki\Minerva\MinervaPagePermissionsTest::testGlobalHideLanguageLinksTakesPrecedenceOnMainPage ( )

MediaWiki defines wgHideInterlanguageLinks which is default set to false, but some wikis can set this config to true.

Minerva page permissions must respect that @covers ::isAllowed

◆ testSwitchLanguagePageAction()

MediaWiki\Minerva\MinervaPagePermissionsTest::testSwitchLanguagePageAction ( $hasLanguagesOrVariants,
$minervaAlwaysShowLanguageButton,
$expected )

The "switch-language" page action is allowed when: v2 of the page action bar is enabled and if the page has interlanguage links or if the $wgMinervaAlwaysShowLanguageButton configuration variable is set to truthy.

@dataProvider switchLanguagePageActionProvider @covers ::isAllowed

◆ testWatchIsAllowedOnlyWhenWatchlistPermissionsAreGranted()

MediaWiki\Minerva\MinervaPagePermissionsTest::testWatchIsAllowedOnlyWhenWatchlistPermissionsAreGranted ( )

Watch action requires 'viewmywatchlist' and 'editmywatchlist' permissions to be grated.

Verify that isAllowedAction('watch') returns false when user do not have those permissions granted @covers ::isAllowed


The documentation for this class was generated from the following file: