MediaWiki  1.23.14
ResourceLoaderTestCase.php
Go to the documentation of this file.
1 <?php
2 
3 abstract class ResourceLoaderTestCase extends MediaWikiTestCase {
4 
5  protected static function getResourceLoaderContext() {
8  'debug' => 'true',
9  'lang' => 'en',
10  'modules' => 'startup',
11  'only' => 'scripts',
12  'skin' => 'vector',
13  'target' => 'test',
14  ) );
16  }
17 
18  protected function setUp() {
19  parent::setUp();
20 
21  $this->setMwGlobals( array(
22  // For ResourceLoader::inDebugMode since it doesn't have context
23  'wgResourceLoaderDebug' => true,
24 
25  // Avoid influence from wgInvalidateCacheOnLocalSettingsChange
26  'wgCacheEpoch' => '20140101000000',
27 
28  // For ResourceLoader::__construct()
29  'wgResourceLoaderSources' => array(),
30 
31  // For wfScript()
32  'wgScriptPath' => '/w',
33  'wgScriptExtension' => '.php',
34  'wgScript' => '/w/index.php',
35  'wgLoadScript' => '/w/load.php',
36  ) );
37  }
38 }
39 
40 /* Stubs */
41 
43 
44  protected $dependencies = array();
45  protected $group = null;
46  protected $source = 'local';
47  protected $targets = array( 'test' );
48 
49  public function __construct( $options = array() ) {
50  foreach ( $options as $key => $value ) {
51  $this->$key = $value;
52  }
53  }
54 
55  public function getDependencies() {
56  return $this->dependencies;
57  }
58 
59  public function getGroup() {
60  return $this->group;
61  }
62 
63  public function getSource() {
64  return $this->source;
65  }
66 }
67 
ResourceLoaderTestCase\setUp
setUp()
Definition: ResourceLoaderTestCase.php:18
ResourceLoaderContext
Object passed around to modules which contains information about the state of a specific loader reque...
Definition: ResourceLoaderContext.php:29
ResourceLoaderTestModule\$source
$source
Definition: ResourceLoaderTestCase.php:46
FauxRequest
WebRequest clone which takes values from a provided array.
Definition: WebRequest.php:1275
$request
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled also a ContextSource error or success you ll probably need to make sure the header is varied on WebRequest $request
Definition: hooks.txt:1961
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ResourceLoaderTestModule\getDependencies
getDependencies()
Get a list of modules this module depends on.
Definition: ResourceLoaderTestCase.php:55
ResourceLoaderFileModuleTestModule
Definition: ResourceLoaderTestCase.php:68
ResourceLoaderTestModule\getGroup
getGroup()
Get the group this module is in.
Definition: ResourceLoaderTestCase.php:59
$resourceLoader
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled also a ContextSource error or success you ll probably need to make sure the header is varied on WebRequest such as when responding to a resource loader request or generating HTML output & $resourceLoader
Definition: hooks.txt:1961
ResourceLoaderFileModule
ResourceLoader module based on local JavaScript/CSS files.
Definition: ResourceLoaderFileModule.php:28
ResourceLoaderTestModule\$dependencies
$dependencies
Definition: ResourceLoaderTestCase.php:44
ResourceLoaderTestCase\getResourceLoaderContext
static getResourceLoaderContext()
Definition: ResourceLoaderTestCase.php:5
MediaWikiTestCase\setMwGlobals
setMwGlobals( $pairs, $value=null)
Definition: MediaWikiTestCase.php:302
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ResourceLoaderTestModule\$group
$group
Definition: ResourceLoaderTestCase.php:45
ResourceLoaderTestModule
Definition: ResourceLoaderTestCase.php:42
$options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition: hooks.txt:1530
$value
$value
Definition: styleTest.css.php:45
ResourceLoaderTestModule\getSource
getSource()
Get the origin of this module.
Definition: ResourceLoaderTestCase.php:63
ResourceLoaderTestModule\$targets
$targets
Definition: ResourceLoaderTestCase.php:47
ResourceLoaderModule
Abstraction for resource loader modules, with name registration and maxage functionality.
Definition: ResourceLoaderModule.php:28
ResourceLoader
Dynamic JavaScript and CSS resource loading system.
Definition: ResourceLoader.php:31
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
ResourceLoaderTestModule\__construct
__construct( $options=array())
Definition: ResourceLoaderTestCase.php:49
ResourceLoaderTestCase
Definition: ResourceLoaderTestCase.php:3