dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
api
/
ApiUserrightsTest.php
diff --git
a/tests/phpunit/includes/api/ApiUserrightsTest.php
b/tests/phpunit/includes/api/ApiUserrightsTest.php
index
5889f82
..
0d7ad0c
100644
(file)
--- a/
tests/phpunit/includes/api/ApiUserrightsTest.php
+++ b/
tests/phpunit/includes/api/ApiUserrightsTest.php
@@
-1,5
+1,8
@@
<?php
<?php
+use MediaWiki\Block\DatabaseBlock;
+use MediaWiki\MediaWikiServices;
+
/**
* @group API
* @group Database
/**
* @group API
* @group Database
@@
-34,6
+37,8
@@
class ApiUserrightsTest extends ApiTestCase {
if ( $remove ) {
$this->mergeMwGlobalArrayValue( 'wgRemoveGroups', [ 'bureaucrat' => $remove ] );
}
if ( $remove ) {
$this->mergeMwGlobalArrayValue( 'wgRemoveGroups', [ 'bureaucrat' => $remove ] );
}
+
+ $this->resetServices();
}
/**
}
/**
@@
-73,6
+78,7
@@
class ApiUserrightsTest extends ApiTestCase {
$res = $this->doApiRequestWithToken( $params );
$user->clearInstanceCache();
$res = $this->doApiRequestWithToken( $params );
$user->clearInstanceCache();
+ MediaWikiServices::getInstance()->getPermissionManager()->invalidateUsersRightsCache();
$this->assertSame( $expectedGroups, $user->getGroups() );
$this->assertArrayNotHasKey( 'warnings', $res[0] );
$this->assertSame( $expectedGroups, $user->getGroups() );
$this->assertArrayNotHasKey( 'warnings', $res[0] );
@@
-128,7
+134,7
@@
class ApiUserrightsTest extends ApiTestCase {
public function testBlockedWithUserrights() {
global $wgUser;
public function testBlockedWithUserrights() {
global $wgUser;
- $block = new Block( [ 'address' => $wgUser, 'by' => $wgUser->getId(), ] );
+ $block = new
Database
Block( [ 'address' => $wgUser, 'by' => $wgUser->getId(), ] );
$block->insert();
try {
$block->insert();
try {
@@
-144,7
+150,7
@@
class ApiUserrightsTest extends ApiTestCase {
$this->setPermissions( true, true );
$this->setPermissions( true, true );
- $block = new Block( [ 'address' => $user, 'by' => $user->getId() ] );
+ $block = new
Database
Block( [ 'address' => $user, 'by' => $user->getId() ] );
$block->insert();
try {
$block->insert();
try {
@@
-215,6
+221,7
@@
class ApiUserrightsTest extends ApiTestCase {
ChangeTags::defineTag( 'custom tag' );
$this->setGroupPermissions( 'user', 'applychangetags', false );
ChangeTags::defineTag( 'custom tag' );
$this->setGroupPermissions( 'user', 'applychangetags', false );
+ $this->resetServices();
$this->doFailedRightsChange(
'You do not have permission to apply change tags along with your changes.',
$this->doFailedRightsChange(
'You do not have permission to apply change tags along with your changes.',