Add partial action block tests to PermissionManagerTest
- Add test for partial block against 'upload' Bug: T281492 Change-Id: I9606bfd0d0645212c62a1611af23ab6befbe1d71
This commit is contained in:
parent
fe657edcbe
commit
0052098f7e
1 changed files with 20 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ use Action;
|
|||
use ContentHandler;
|
||||
use FauxRequest;
|
||||
use MediaWiki\Block\DatabaseBlock;
|
||||
use MediaWiki\Block\Restriction\ActionRestriction;
|
||||
use MediaWiki\Block\Restriction\NamespaceRestriction;
|
||||
use MediaWiki\Block\Restriction\PageRestriction;
|
||||
use MediaWiki\Block\SystemBlock;
|
||||
|
|
@ -389,6 +390,7 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
|
|||
public function testCheckUserBlockActions( $block, $restriction, $expected ) {
|
||||
$this->setMwGlobals( [
|
||||
'wgEmailConfirmToEdit' => false,
|
||||
'wgEnablePartialActionBlocks' => true,
|
||||
] );
|
||||
|
||||
if ( $restriction ) {
|
||||
|
|
@ -499,6 +501,24 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
|
|||
'purge' => false,
|
||||
]
|
||||
],
|
||||
'Partial block with action restriction against uploading' => [
|
||||
( new DatabaseBlock( [
|
||||
'address' => '127.0.8.1',
|
||||
'by' => 100,
|
||||
'sitewide' => false,
|
||||
] ) )->setRestrictions( [
|
||||
new ActionRestriction( 0, 1 )
|
||||
] ),
|
||||
false,
|
||||
[
|
||||
'edit' => false,
|
||||
'move-target' => false,
|
||||
'rollback' => false,
|
||||
'patrol' => false,
|
||||
'upload' => true,
|
||||
'purge' => false,
|
||||
]
|
||||
],
|
||||
'System block' => [
|
||||
new SystemBlock( [
|
||||
'address' => '127.0.8.1',
|
||||
|
|
|
|||
Loading…
Reference in a new issue