MediaWiki  REL1_24
ResourceLoaderTestModule Class Reference
Inheritance diagram for ResourceLoaderTestModule:
Collaboration diagram for ResourceLoaderTestModule:

List of all members.

Public Member Functions

 __construct ($options=array())
 getDependencies ()
 Get a list of modules this module depends on.
 getGroup ()
 Get the group this module is in.
 getScript (ResourceLoaderContext $context)
 Get all JS for this module for a given language and skin.
 getSkipFunction ()
 Get the skip function.
 getSource ()
 Get the origin of this module.
 getStyles (ResourceLoaderContext $context)
 Get all CSS for this module for a given skin.
 isRaw ()
 Whether this module's JS expects to work without the client-side ResourceLoader module.

Protected Attributes

 $dependencies = array()
 $group = null
 $isRaw = false
 $script = ''
 $skipFunction = null
 $source = 'local'
 $styles = ''
 $targets = array( 'test' )

Detailed Description

Definition at line 42 of file ResourceLoaderTestCase.php.


Constructor & Destructor Documentation

Definition at line 52 of file ResourceLoaderTestCase.php.

References $key, $options, $value, and as.


Member Function Documentation

Get a list of modules this module depends on.

Dependency information is taken into account when loading a module on the client side.

To add dependencies dynamically on the client side, use a custom loader script, see getLoaderScript()

Returns:
array List of module names as strings

Reimplemented from ResourceLoaderModule.

Definition at line 66 of file ResourceLoaderTestCase.php.

Get the group this module is in.

Returns:
string Group name

Reimplemented from ResourceLoaderModule.

Definition at line 70 of file ResourceLoaderTestCase.php.

Get all JS for this module for a given language and skin.

Includes all relevant JS except loader scripts.

Parameters:
ResourceLoaderContext$context
Returns:
string JavaScript code

Reimplemented from ResourceLoaderModule.

Definition at line 58 of file ResourceLoaderTestCase.php.

Get the skip function.

Modules that provide fallback functionality can provide a "skip function". This function, if provided, will be passed along to the module registry on the client. When this module is loaded (either directly or as a dependency of another module), then this function is executed first. If the function returns true, the module will instantly be considered "ready" without requesting the associated module resources.

The value returned here must be valid javascript for execution in a private function. It must not contain the "function () {" and "}" wrapper though.

Returns:
string|null A JavaScript function body returning a boolean value, or null

Reimplemented from ResourceLoaderModule.

Definition at line 78 of file ResourceLoaderTestCase.php.

Get the origin of this module.

Should only be overridden for foreign modules.

Returns:
string Origin name, 'local' for local modules

Reimplemented from ResourceLoaderModule.

Definition at line 74 of file ResourceLoaderTestCase.php.

References source.

Get all CSS for this module for a given skin.

Parameters:
ResourceLoaderContext$context
Returns:
array List of CSS strings or array of CSS strings keyed by media type. like array( 'screen' => '.foo { width: 0 }' ); or array( 'screen' => array( '.foo { width: 0 }' ) );

Reimplemented from ResourceLoaderModule.

Definition at line 62 of file ResourceLoaderTestCase.php.

References array().

Whether this module's JS expects to work without the client-side ResourceLoader module.

Returning true from this function will prevent mw.loader.state() call from being appended to the bottom of the script.

Returns:
bool

Reimplemented from ResourceLoaderModule.

Definition at line 82 of file ResourceLoaderTestCase.php.


Member Data Documentation

ResourceLoaderTestModule::$dependencies = array() [protected]

Definition at line 43 of file ResourceLoaderTestCase.php.

ResourceLoaderTestModule::$group = null [protected]

Definition at line 44 of file ResourceLoaderTestCase.php.

ResourceLoaderTestModule::$isRaw = false [protected]

Definition at line 49 of file ResourceLoaderTestCase.php.

ResourceLoaderTestModule::$script = '' [protected]

Definition at line 46 of file ResourceLoaderTestCase.php.

ResourceLoaderTestModule::$skipFunction = null [protected]

Definition at line 48 of file ResourceLoaderTestCase.php.

ResourceLoaderTestModule::$source = 'local' [protected]

Definition at line 45 of file ResourceLoaderTestCase.php.

ResourceLoaderTestModule::$styles = '' [protected]

Definition at line 47 of file ResourceLoaderTestCase.php.

ResourceLoaderTestModule::$targets = array( 'test' ) [protected]

Reimplemented from ResourceLoaderModule.

Definition at line 50 of file ResourceLoaderTestCase.php.


The documentation for this class was generated from the following file: