*/
protected function getResourceLoaderContext( $lang = 'en', $dir = 'ltr' ) {
$resourceLoader = new ResourceLoader();
- $request = new FauxRequest( array(
+ $request = new FauxRequest( [
'lang' => $lang,
'modules' => 'startup',
'only' => 'scripts',
'skin' => 'vector',
'target' => 'phpunit',
- ) );
+ ] );
$ctx = $this->getMockBuilder( 'ResourceLoaderContext' )
- ->setConstructorArgs( array( $resourceLoader, $request ) )
- ->setMethods( array( 'getDirection' ) )
+ ->setConstructorArgs( [ $resourceLoader, $request ] )
+ ->setMethods( [ 'getDirection' ] )
->getMock();
$ctx->expects( $this->any() )->method( 'getDirection' )->will(
$this->returnValue( $dir )
}
public static function getSettings() {
- return array(
+ return [
// For ResourceLoader::inDebugMode since it doesn't have context
'ResourceLoaderDebug' => true,
'CacheEpoch' => '20140101000000',
// For ResourceLoader::__construct()
- 'ResourceLoaderSources' => array(),
+ 'ResourceLoaderSources' => [],
// For wfScript()
'ScriptPath' => '/w',
'ScriptExtension' => '.php',
'Script' => '/w/index.php',
'LoadScript' => '/w/load.php',
- );
+ ];
}
protected function setUp() {
ResourceLoader::clearCache();
- $globals = array();
+ $globals = [];
foreach ( self::getSettings() as $key => $value ) {
$globals['wg' . $key] = $value;
}
/* Stubs */
class ResourceLoaderTestModule extends ResourceLoaderModule {
- protected $messages = array();
- protected $dependencies = array();
+ protected $messages = [];
+ protected $dependencies = [];
protected $group = null;
protected $source = 'local';
protected $script = '';
protected $styles = '';
protected $skipFunction = null;
protected $isRaw = false;
- protected $targets = array( 'phpunit' );
+ protected $targets = [ 'phpunit' ];
- public function __construct( $options = array() ) {
+ public function __construct( $options = [] ) {
foreach ( $options as $key => $value ) {
$this->$key = $value;
}
}
public function getStyles( ResourceLoaderContext $context ) {
- return array( '' => $this->styles );
+ return [ '' => $this->styles ];
}
public function getMessages() {