X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiUserrightsTest.php;h=0d7ad0c502013faa1617280a0a0760a17dc6cb22;hb=dfec83932fd38a9086eb5a2e212889ad00f35b0e;hp=5889f8265ac2f8fbcd9a8c2b96ef4fdb02a6575f;hpb=ba32e133e97b0f1f6b9ddb7e3c7a9cc79d0be977;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/ApiUserrightsTest.php b/tests/phpunit/includes/api/ApiUserrightsTest.php index 5889f8265a..0d7ad0c502 100644 --- a/tests/phpunit/includes/api/ApiUserrightsTest.php +++ b/tests/phpunit/includes/api/ApiUserrightsTest.php @@ -1,5 +1,8 @@ mergeMwGlobalArrayValue( 'wgRemoveGroups', [ 'bureaucrat' => $remove ] ); } + + $this->resetServices(); } /** @@ -73,6 +78,7 @@ class ApiUserrightsTest extends ApiTestCase { $res = $this->doApiRequestWithToken( $params ); $user->clearInstanceCache(); + MediaWikiServices::getInstance()->getPermissionManager()->invalidateUsersRightsCache(); $this->assertSame( $expectedGroups, $user->getGroups() ); $this->assertArrayNotHasKey( 'warnings', $res[0] ); @@ -128,7 +134,7 @@ class ApiUserrightsTest extends ApiTestCase { public function testBlockedWithUserrights() { global $wgUser; - $block = new Block( [ 'address' => $wgUser, 'by' => $wgUser->getId(), ] ); + $block = new DatabaseBlock( [ 'address' => $wgUser, 'by' => $wgUser->getId(), ] ); $block->insert(); try { @@ -144,7 +150,7 @@ class ApiUserrightsTest extends ApiTestCase { $this->setPermissions( true, true ); - $block = new Block( [ 'address' => $user, 'by' => $user->getId() ] ); + $block = new DatabaseBlock( [ 'address' => $user, 'by' => $user->getId() ] ); $block->insert(); try { @@ -215,6 +221,7 @@ class ApiUserrightsTest extends ApiTestCase { 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.',