X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fspecials%2FSpecialPreferencesTest.php;h=510a2f291c350266735e04b8baf26454ca3d5dec;hp=cd6cd3be1f13f73163c73cb603be37faa0850d4c;hb=9c7f6734c397a954b8eaa5ec73876f2b4bf92afb;hpb=4533986087e6eec9c5bd2542705b4ab1dd7869a7 diff --git a/tests/phpunit/includes/specials/SpecialPreferencesTest.php b/tests/phpunit/includes/specials/SpecialPreferencesTest.php index cd6cd3be1f..510a2f291c 100644 --- a/tests/phpunit/includes/specials/SpecialPreferencesTest.php +++ b/tests/phpunit/includes/specials/SpecialPreferencesTest.php @@ -21,10 +21,9 @@ class SpecialPreferencesTest extends MediaWikiTestCase { * Test specifications by Alexandre "ialex" Emsenhuber. * @todo give this test a real name explaining what is being tested here */ - public function testBug41337() { + public function testT43337() { // Set a low limit $this->setMwGlobals( 'wgMaxSigChars', 2 ); - $user = $this->createMock( User::class ); $user->expects( $this->any() ) ->method( 'isAnon' ) @@ -47,6 +46,10 @@ class SpecialPreferencesTest extends MediaWikiTestCase { $user->method( 'getOptions' ) ->willReturn( [] ); + // isAnyAllowed used to return null from the mock, + // thus revoke it's permissions. + $this->overrideUserPermissions( $user, [] ); + # Forge a request to call the special page $context = new RequestContext(); $context->setRequest( new FauxRequest() );