3 abstract class ResourceLoaderTestCase
extends MediaWikiTestCase
{
4 protected static function getResourceLoaderContext() {
5 $resourceLoader = new ResourceLoader();
6 $request = new FauxRequest( array(
9 'modules' => 'startup',
14 return new ResourceLoaderContext( $resourceLoader, $request );
17 protected function setUp() {
20 $this->setMwGlobals( array(
21 // For ResourceLoader::inDebugMode since it doesn't have context
22 'wgResourceLoaderDebug' => true,
24 // Avoid influence from wgInvalidateCacheOnLocalSettingsChange
25 'wgCacheEpoch' => '20140101000000',
27 // For ResourceLoader::__construct()
28 'wgResourceLoaderSources' => array(),
31 'wgScriptPath' => '/w',
32 'wgScriptExtension' => '.php',
33 'wgScript' => '/w/index.php',
34 'wgLoadScript' => '/w/load.php',
41 class ResourceLoaderTestModule
extends ResourceLoaderModule
{
42 protected $dependencies = array();
43 protected $group = null;
44 protected $source = 'local';
45 protected $targets = array( 'test' );
47 public function __construct( $options = array() ) {
48 foreach ( $options as $key => $value ) {
53 public function getDependencies() {
54 return $this->dependencies
;
57 public function getGroup() {
61 public function getSource() {
66 class ResourceLoaderFileModuleTestModule
extends ResourceLoaderFileModule
{