MediaWiki  master
MediaWiki\Tests\Permissions\PermissionManagerTest Class Reference

Database. More...

Inheritance diagram for MediaWiki\Tests\Permissions\PermissionManagerTest:
Collaboration diagram for MediaWiki\Tests\Permissions\PermissionManagerTest:

Public Member Functions

 tearDown ()
 
 testActionPermissions ()
 
 testAddTemporaryUserRights ()
 \MediaWiki\Permissions\PermissionManager::addTemporaryUserRights More...
 
 testBlockInstanceCache ()
 \MediaWiki\Permissions\PermissionManager::isBlockedFrom More...
 
 testCascadingSourcesRestrictions ()
 \MediaWiki\Permissions\PermissionManager::checkCascadingSourcesRestrictions More...
 
 testCssConfigEditPermissions ()
 
 testGetGroupsWithPermission ( $expected, $right)
 provideGetGroupsWithPermission \MediaWiki\Permissions\PermissionManager::getGroupsWithPermission More...
 
 testGetUserPermissions ()
 \MediaWiki\Permissions\PermissionManager::getUserPermissions More...
 
 testGetUserPermissionsHooks ()
 \MediaWiki\Permissions\PermissionManager::getUserPermissions More...
 
 testGroupHasPermission ()
 \MediaWiki\Permissions\PermissionManager::groupHasPermission More...
 
 testGroupPermissions ()
 \MediaWiki\Permissions\PermissionManager::getGroupPermissions More...
 
 testIsBlockedFrom ( $title, $expect, array $options=[])
 \MediaWiki\Permissions\PermissionManager::isBlockedFrom provideIsBlockedFrom More...
 
 testIsEveryoneAllowed ()
 \MediaWiki\Permissions\PermissionManager::isEveryoneAllowed More...
 
 testJsConfigEditPermissions ()
 
 testJsConfigRedirectEditPermissions ()
 
 testJsonConfigEditPermissions ()
 
 testOtherCssConfigEditPermissions ()
 
 testOtherJsConfigEditPermissions ()
 
 testOtherJsonConfigEditPermissions ()
 
 testOtherNonConfigEditPermissions ()
 
 testPageRestrictions ()
 
 testPatrolActionConfigEditPermissions ()
 
 testQuickPermissions ()
 
 testRevokePermissions ()
 \MediaWiki\Permissions\PermissionManager::getGroupPermissions More...
 
 testSpecialsAndNSPermissions ()
 
 testUserBlock ()
 \MediaWiki\Permissions\PermissionManager::checkUserBlock More...
 
 testUserBlockAction ()
 \MediaWiki\Permissions\PermissionManager::checkUserBlock More...
 
 testUserHasRight ()
 \MediaWiki\Permissions\PermissionManager::userHasRight More...
 

Static Public Member Functions

static provideGetGroupsWithPermission ()
 
static provideIsBlockedFrom ()
 

Public Attributes

User $altUser
 
string $altUserName
 
User $anonUser
 
User $userUser
 
const USER_TALK_PAGE = '<user talk page>'
 Constant for self::testIsBlockedFrom. More...
 

Protected Member Functions

 runConfigEditPermissions ( $resultNone, $resultMyCss, $resultMyJson, $resultMyJs, $resultUserCss, $resultUserJson, $resultUserJs, $resultPatrol)
 
 runGroupPermissions ( $perm, $action, $result, $result2=null)
 
 setTitle ( $ns, $title="Main_Page")
 
 setUp ()
 
 setUser ( $userName=null)
 
- Protected Member Functions inherited from MediaWikiLangTestCase
 setUp ()
 

Protected Attributes

Title $title
 
User $user
 
string $userName
 

Private Member Functions

 getJavascriptRedirectRevision (Title $title, Title $redirectTargetTitle, User $user)
 Create a RevisionRecord with a single Javascript redirect main slot. More...
 
 getJavascriptRevision (Title $title, User $user, $text)
 Create a RevisionRecord with a single Javascript main slot. More...
 

Detailed Description

Database.

\MediaWiki\Permissions\PermissionManager

Definition at line 32 of file PermissionManagerTest.php.

Member Function Documentation

◆ getJavascriptRedirectRevision()

MediaWiki\Tests\Permissions\PermissionManagerTest::getJavascriptRedirectRevision ( Title  $title,
Title  $redirectTargetTitle,
User  $user 
)
private

Create a RevisionRecord with a single Javascript redirect main slot.

Parameters
Title$title
Title$redirectTargetTitle
User$user
Returns
MutableRevisionRecord

Definition at line 1769 of file PermissionManagerTest.php.

References $content, CONTENT_MODEL_JAVASCRIPT, and ContentHandler\getForModelID().

Referenced by MediaWiki\Tests\Permissions\PermissionManagerTest\testJsConfigRedirectEditPermissions().

◆ getJavascriptRevision()

MediaWiki\Tests\Permissions\PermissionManagerTest::getJavascriptRevision ( Title  $title,
User  $user,
  $text 
)
private

Create a RevisionRecord with a single Javascript main slot.

Parameters
Title$title
User$user
string$text
Returns
MutableRevisionRecord

Definition at line 1755 of file PermissionManagerTest.php.

References $content, CONTENT_MODEL_JAVASCRIPT, and ContentHandler\makeContent().

Referenced by MediaWiki\Tests\Permissions\PermissionManagerTest\testJsConfigRedirectEditPermissions().

◆ provideGetGroupsWithPermission()

static MediaWiki\Tests\Permissions\PermissionManagerTest::provideGetGroupsWithPermission ( )
static

Definition at line 1640 of file PermissionManagerTest.php.

◆ provideIsBlockedFrom()

static MediaWiki\Tests\Permissions\PermissionManagerTest::provideIsBlockedFrom ( )
static

Definition at line 1454 of file PermissionManagerTest.php.

References NS_USER_TALK, and true.

◆ runConfigEditPermissions()

◆ runGroupPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::runGroupPermissions (   $perm,
  $action,
  $result,
  $result2 = null 
)
protected

◆ setTitle()

◆ setUp()

◆ setUser()

◆ tearDown()

MediaWiki\Tests\Permissions\PermissionManagerTest::tearDown ( )

Definition at line 125 of file PermissionManagerTest.php.

◆ testActionPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testActionPermissions ( )

◆ testAddTemporaryUserRights()

MediaWiki\Tests\Permissions\PermissionManagerTest::testAddTemporaryUserRights ( )

◆ testBlockInstanceCache()

MediaWiki\Tests\Permissions\PermissionManagerTest::testBlockInstanceCache ( )

◆ testCascadingSourcesRestrictions()

◆ testCssConfigEditPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testCssConfigEditPermissions ( )

◆ testGetGroupsWithPermission()

MediaWiki\Tests\Permissions\PermissionManagerTest::testGetGroupsWithPermission (   $expected,
  $right 
)

◆ testGetUserPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testGetUserPermissions ( )

◆ testGetUserPermissionsHooks()

MediaWiki\Tests\Permissions\PermissionManagerTest::testGetUserPermissionsHooks ( )

◆ testGroupHasPermission()

MediaWiki\Tests\Permissions\PermissionManagerTest::testGroupHasPermission ( )

◆ testGroupPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testGroupPermissions ( )

◆ testIsBlockedFrom()

MediaWiki\Tests\Permissions\PermissionManagerTest::testIsBlockedFrom (   $title,
  $expect,
array  $options = [] 
)

\MediaWiki\Permissions\PermissionManager::isBlockedFrom provideIsBlockedFrom

Parameters
string | null$titleTitle to test.
bool$expectExpected result from User::isBlockedFrom()
array$optionsAdditional test options:
  • 'blockAllowsUTEdit': (bool, default true) Value for $wgBlockAllowsUTEdit
  • 'allowUsertalk': (bool, default false) Passed to DatabaseBlock::__construct()
  • 'pageRestrictions': (array|null) If non-empty, page restriction titles for the block.

Definition at line 1410 of file PermissionManagerTest.php.

References $options, as, MediaWiki\MediaWikiServices\getInstance(), User\getTalkPage(), Title\newFromText(), and wfTimestamp().

◆ testIsEveryoneAllowed()

MediaWiki\Tests\Permissions\PermissionManagerTest::testIsEveryoneAllowed ( )

◆ testJsConfigEditPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testJsConfigEditPermissions ( )

◆ testJsConfigRedirectEditPermissions()

◆ testJsonConfigEditPermissions()

◆ testOtherCssConfigEditPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testOtherCssConfigEditPermissions ( )

◆ testOtherJsConfigEditPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testOtherJsConfigEditPermissions ( )

◆ testOtherJsonConfigEditPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testOtherJsonConfigEditPermissions ( )

◆ testOtherNonConfigEditPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testOtherNonConfigEditPermissions ( )

◆ testPageRestrictions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testPageRestrictions ( )
Todo:
This test method should be split up into separate test methods and data providers

This test is failing per T201776.

Broken \MediaWiki\Permissions\PermissionManager::checkPageRestrictions

Definition at line 872 of file PermissionManagerTest.php.

References MediaWiki\MediaWikiServices\getInstance(), NS_MAIN, NS_PROJECT, MediaWiki\Tests\Permissions\PermissionManagerTest\setTitle(), title, and user.

◆ testPatrolActionConfigEditPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testPatrolActionConfigEditPermissions ( )

◆ testQuickPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testQuickPermissions ( )

◆ testRevokePermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testRevokePermissions ( )

◆ testSpecialsAndNSPermissions()

MediaWiki\Tests\Permissions\PermissionManagerTest::testSpecialsAndNSPermissions ( )

◆ testUserBlock()

◆ testUserBlockAction()

MediaWiki\Tests\Permissions\PermissionManagerTest::testUserBlockAction ( )

\MediaWiki\Permissions\PermissionManager::checkUserBlock

Tests to determine that the passed in permission does not get mixed up with an action of the same name.

Definition at line 1307 of file PermissionManagerTest.php.

References $wgLang, class, MediaWiki\MediaWikiServices\getInstance(), null, title, user, and wfTimestamp().

◆ testUserHasRight()

MediaWiki\Tests\Permissions\PermissionManagerTest::testUserHasRight ( )

Member Data Documentation

◆ $altUser

User MediaWiki\Tests\Permissions\PermissionManagerTest::$altUser

◆ $altUserName

string MediaWiki\Tests\Permissions\PermissionManagerTest::$altUserName

Definition at line 37 of file PermissionManagerTest.php.

◆ $anonUser

User MediaWiki\Tests\Permissions\PermissionManagerTest::$anonUser

◆ $title

Title MediaWiki\Tests\Permissions\PermissionManagerTest::$title
protected

Definition at line 42 of file PermissionManagerTest.php.

◆ $user

User MediaWiki\Tests\Permissions\PermissionManagerTest::$user
protected

Definition at line 47 of file PermissionManagerTest.php.

◆ $userName

string MediaWiki\Tests\Permissions\PermissionManagerTest::$userName
protected

Definition at line 37 of file PermissionManagerTest.php.

◆ $userUser

User MediaWiki\Tests\Permissions\PermissionManagerTest::$userUser

◆ USER_TALK_PAGE

const MediaWiki\Tests\Permissions\PermissionManagerTest::USER_TALK_PAGE = '<user talk page>'

Constant for self::testIsBlockedFrom.

Definition at line 50 of file PermissionManagerTest.php.


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