// 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 ) );
# 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
# Do the call, should not spurt a fatal error.
$special = new SpecialPreferences();
$special->setContext( $context );
- $this->assertNull( $special->execute( array() ) );
+ $this->assertNull( $special->execute( [] ) );
}
}