Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / ResourceLoaderTestCase.php
blobf8c4c6c8ae1b740f708487ddfd11ab379bf61109
1 <?php
3 abstract class ResourceLoaderTestCase extends MediaWikiTestCase {
4 protected static function getResourceLoaderContext() {
5 $resourceLoader = new ResourceLoader();
6 $request = new FauxRequest( array(
7 'debug' => 'true',
8 'lang' => 'en',
9 'modules' => 'startup',
10 'only' => 'scripts',
11 'skin' => 'vector',
12 'target' => 'test',
13 ) );
14 return new ResourceLoaderContext( $resourceLoader, $request );
17 protected function setUp() {
18 parent::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(),
30 // For wfScript()
31 'wgScriptPath' => '/w',
32 'wgScriptExtension' => '.php',
33 'wgScript' => '/w/index.php',
34 'wgLoadScript' => '/w/load.php',
35 ) );
39 /* Stubs */
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 ) {
49 $this->$key = $value;
53 public function getDependencies() {
54 return $this->dependencies;
57 public function getGroup() {
58 return $this->group;
61 public function getSource() {
62 return $this->source;
66 class ResourceLoaderFileModuleTestModule extends ResourceLoaderFileModule {