X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fspecials%2FSpecialPreferencesTest.php;h=ac58d68c57c266e03c5904a1bf317964cb9936f9;hb=2c12b1fd2afc14a03c16f05c844320985d911ca0;hp=1545d7ecccbbc1c664753f76402e11f054e622e6;hpb=9c092814c7f275db78a6ed769aa76fdd87709c60;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/specials/SpecialPreferencesTest.php b/tests/phpunit/includes/specials/SpecialPreferencesTest.php index 1545d7eccc..ac58d68c57 100644 --- a/tests/phpunit/includes/specials/SpecialPreferencesTest.php +++ b/tests/phpunit/includes/specials/SpecialPreferencesTest.php @@ -21,11 +21,10 @@ class SpecialPreferencesTest extends MediaWikiTestCase { * @todo give this test a real name explaining what is being tested here */ public function testBug41337() { - // Set a low limit $this->setMwGlobals( 'wgMaxSigChars', 2 ); - $user = $this->getMock( 'User' ); + $user = $this->createMock( 'User' ); $user->expects( $this->any() ) ->method( 'isAnon' ) ->will( $this->returnValue( false ) ); @@ -33,14 +32,14 @@ class SpecialPreferencesTest extends MediaWikiTestCase { # Yeah foreach requires an array, not NULL =( $user->expects( $this->any() ) ->method( 'getEffectiveGroups' ) - ->will( $this->returnValue( array() ) ); + ->will( $this->returnValue( [] ) ); # The mocked user has a long nickname $user->expects( $this->any() ) ->method( 'getOption' ) - ->will( $this->returnValueMap( array( - array( 'nickname', null, false, 'superlongnickname' ), - ) + ->will( $this->returnValueMap( [ + [ 'nickname', null, false, 'superlongnickname' ], + ] ) ); # Forge a request to call the special page @@ -52,7 +51,7 @@ class SpecialPreferencesTest extends MediaWikiTestCase { # Do the call, should not spurt a fatal error. $special = new SpecialPreferences(); $special->setContext( $context ); - $this->assertNull( $special->execute( array() ) ); + $this->assertNull( $special->execute( [] ) ); } }