MediaWiki  master
ResourceLoaderTest Class Reference
Inheritance diagram for ResourceLoaderTest:
Collaboration diagram for ResourceLoaderTest:

Public Member Functions

 provideTestIsFileModule ()
 
 testAddSource ( $name, $info, $expected)
 provideAddSource ResourceLoader::addSource ResourceLoader::getSources More...
 
 testAddSourceDupe ()
 ResourceLoader::addSource. More...
 
 testAddSourceInvalid ()
 ResourceLoader::addSource. More...
 
 testExpandModuleNames ( $desc, $modules, $packed, $unpacked=null)
 providePackedModules ResourceLoader::expandModuleNames More...
 
 testGetCombinedVersion ()
 ResourceLoader::getCombinedVersion. More...
 
 testGetLoadScript ()
 ResourceLoader::getLoadScript. More...
 
 testGetModuleClass ()
 ResourceLoader::getModule. More...
 
 testGetModuleClassDefault ()
 ResourceLoader::getModule. More...
 
 testGetModuleFactory ()
 ResourceLoader::getModule. More...
 
 testGetModuleNames ()
 ResourceLoader::getModuleNames. More...
 
 testGetModuleUnknown ()
 ResourceLoader::getModule. More...
 
 testIsFileModule ( $expected, $module)
 provideTestIsFileModule ResourceLoader::isFileModule More...
 
 testIsFileModuleUnknown ()
 ResourceLoader::isFileModule. More...
 
 testIsModuleRegistered ()
 ResourceLoader::isModuleRegistered. More...
 
 testIsValidModuleName_invalid ( $name)
 provideInvalidModuleName ResourceLoader More...
 
 testIsValidModuleName_valid ( $name)
 provideValidModuleName ResourceLoader More...
 
 testLessImportDirs ()
 ResourceLoader::getLessCompiler. More...
 
 testMakeLoaderImplementScript ( $case)
 provideLoaderImplement ResourceLoader::makeLoaderImplementScript ResourceLoader::trimArray More...
 
 testMakeLoaderImplementScriptInvalid ()
 ResourceLoader::makeLoaderImplementScript. More...
 
 testMakeLoaderRegisterScript ()
 ResourceLoader::makeLoaderRegisterScript. More...
 
 testMakeLoaderSourcesScript ()
 ResourceLoader::makeLoaderSourcesScript. More...
 
 testMakeModuleResponseConcat ( $scripts, $expected, $debug, $message=null)
 Verify how multiple scripts and mw.loader.state() calls are concatenated. More...
 
 testMakeModuleResponseEmpty ()
 ResourceLoader::makeModuleResponse. More...
 
 testMakeModuleResponseError ()
 Verify that when building module content in a load.php response, an exception from one module will not break script output from other modules. More...
 
 testMakeModuleResponseErrorCSS ()
 Verify that exceptions in PHP for one module will not break others (stylesheet response). More...
 
 testMakeModuleResponseExtraHeaders ()
 Integration test for modules sending extra HTTP response headers. More...
 
 testMakeModuleResponseExtraHeadersMulti ()
 ResourceLoaderModule::getHeaders ResourceLoaderModule::buildContent ResourceLoader::makeModuleResponse. More...
 
 testMakeModuleResponseStartupError ()
 Verify that when building the startup module response, an exception from one module class will not break the entire startup module response. More...
 
 testMakePackedModulesString ( $desc, $modules, $packed)
 providePackedModules ResourceLoader::makePackedModulesString More...
 
 testMeasureResponseTime ()
 ResourceLoader::measureResponseTime. More...
 
 testRegisterDuplicate ()
 ResourceLoader::register. More...
 
 testRegisterEmptyString ()
 ResourceLoader::register medium. More...
 
 testRegisterInvalidName ()
 ResourceLoader::register medium. More...
 
 testRegisterInvalidType ()
 ResourceLoader::register. More...
 
 testRegisterValidArray ()
 ResourceLoader::register ResourceLoader::getModule. More...
 
 testRespondEmpty ()
 ResourceLoader::respond. More...
 
 testRespondInternalFailures ()
 ResourceLoader::respond. More...
 
 testRespondSimple ()
 ResourceLoader::respond. More...
 
 testServiceWiring ()
 Ensure the ResourceLoaderRegisterModules hook is called. More...
 

Static Public Member Functions

static provideAddSource ()
 
static provideInvalidModuleName ()
 
static provideLoaderImplement ()
 
static provideMakeModuleResponseConcat ()
 
static providePackedModules ()
 
static provideValidModuleName ()
 
- Static Public Member Functions inherited from ResourceLoaderTestCase
static getMinimalConfig ()
 
static getSettings ()
 

Protected Member Functions

 getFailFerryMock ( $getter='getScript')
 
 getSimpleModuleMock ( $script='')
 
 getSimpleStyleModuleMock ( $styles='')
 
 setUp ()
 
- Protected Member Functions inherited from ResourceLoaderTestCase
 getResourceLoaderContext ( $options=[], ResourceLoader $rl=null)
 
 setUp ()
 

Static Private Member Functions

static fakeSources ()
 

Additional Inherited Members

- Public Attributes inherited from ResourceLoaderTestCase
const BLANK_VERSION = '09p30q0'
 

Detailed Description

Definition at line 6 of file ResourceLoaderTest.php.

Member Function Documentation

◆ fakeSources()

static ResourceLoaderTest::fakeSources ( )
staticprivate

Definition at line 647 of file ResourceLoaderTest.php.

◆ getFailFerryMock()

ResourceLoaderTest::getFailFerryMock (   $getter = 'getScript')
protected

Definition at line 679 of file ResourceLoaderTest.php.

References class.

◆ getSimpleModuleMock()

ResourceLoaderTest::getSimpleModuleMock (   $script = '')
protected

Definition at line 689 of file ResourceLoaderTest.php.

References class.

◆ getSimpleStyleModuleMock()

ResourceLoaderTest::getSimpleStyleModuleMock (   $styles = '')
protected

Definition at line 697 of file ResourceLoaderTest.php.

References class.

◆ provideAddSource()

static ResourceLoaderTest::provideAddSource ( )
static

Definition at line 338 of file ResourceLoaderTest.php.

References null.

◆ provideInvalidModuleName()

static ResourceLoaderTest::provideInvalidModuleName ( )
static

Definition at line 37 of file ResourceLoaderTest.php.

◆ provideLoaderImplement()

static ResourceLoaderTest::provideLoaderImplement ( )
static

Definition at line 391 of file ResourceLoaderTest.php.

◆ provideMakeModuleResponseConcat()

static ResourceLoaderTest::provideMakeModuleResponseConcat ( )
static

Definition at line 744 of file ResourceLoaderTest.php.

References $ret, and as.

◆ providePackedModules()

static ResourceLoaderTest::providePackedModules ( )
static

Definition at line 287 of file ResourceLoaderTest.php.

◆ provideTestIsFileModule()

ResourceLoaderTest::provideTestIsFileModule ( )

Definition at line 152 of file ResourceLoaderTest.php.

References class, and use.

◆ provideValidModuleName()

static ResourceLoaderTest::provideValidModuleName ( )
static

Definition at line 46 of file ResourceLoaderTest.php.

◆ setUp()

ResourceLoaderTest::setUp ( )
protected

Definition at line 8 of file ResourceLoaderTest.php.

◆ testAddSource()

ResourceLoaderTest::testAddSource (   $name,
  $info,
  $expected 
)

◆ testAddSourceDupe()

ResourceLoaderTest::testAddSourceDupe ( )

ResourceLoader::addSource.

Definition at line 373 of file ResourceLoaderTest.php.

References class.

◆ testAddSourceInvalid()

ResourceLoaderTest::testAddSourceInvalid ( )

ResourceLoader::addSource.

Definition at line 385 of file ResourceLoaderTest.php.

References class.

◆ testExpandModuleNames()

ResourceLoaderTest::testExpandModuleNames (   $desc,
  $modules,
  $packed,
  $unpacked = null 
)

providePackedModules ResourceLoader::expandModuleNames

Definition at line 330 of file ResourceLoaderTest.php.

References $modules, and ResourceLoader\expandModuleNames().

◆ testGetCombinedVersion()

ResourceLoaderTest::testGetCombinedVersion ( )

◆ testGetLoadScript()

ResourceLoaderTest::testGetLoadScript ( )

ResourceLoader::getLoadScript.

Definition at line 663 of file ResourceLoaderTest.php.

References $e, $name, and as.

◆ testGetModuleClass()

ResourceLoaderTest::testGetModuleClass ( )

ResourceLoader::getModule.

Definition at line 234 of file ResourceLoaderTest.php.

References class.

◆ testGetModuleClassDefault()

ResourceLoaderTest::testGetModuleClassDefault ( )

ResourceLoader::getModule.

Definition at line 263 of file ResourceLoaderTest.php.

References class.

◆ testGetModuleFactory()

ResourceLoaderTest::testGetModuleFactory ( )

ResourceLoader::getModule.

Definition at line 246 of file ResourceLoaderTest.php.

References class.

◆ testGetModuleNames()

ResourceLoaderTest::testGetModuleNames ( )

◆ testGetModuleUnknown()

ResourceLoaderTest::testGetModuleUnknown ( )

ResourceLoader::getModule.

Definition at line 226 of file ResourceLoaderTest.php.

References null.

◆ testIsFileModule()

ResourceLoaderTest::testIsFileModule (   $expected,
  $module 
)

provideTestIsFileModule ResourceLoader::isFileModule

Definition at line 199 of file ResourceLoaderTest.php.

◆ testIsFileModuleUnknown()

ResourceLoaderTest::testIsFileModuleUnknown ( )

◆ testIsModuleRegistered()

ResourceLoaderTest::testIsModuleRegistered ( )

◆ testIsValidModuleName_invalid()

ResourceLoaderTest::testIsValidModuleName_invalid (   $name)

provideInvalidModuleName ResourceLoader

Definition at line 61 of file ResourceLoaderTest.php.

References $name, and ResourceLoader\isValidModuleName().

◆ testIsValidModuleName_valid()

ResourceLoaderTest::testIsValidModuleName_valid (   $name)

provideValidModuleName ResourceLoader

Definition at line 69 of file ResourceLoaderTest.php.

References $name, and ResourceLoader\isValidModuleName().

◆ testLessImportDirs()

ResourceLoaderTest::testLessImportDirs ( )

ResourceLoader::getLessCompiler.

Definition at line 276 of file ResourceLoaderTest.php.

References $basePath, and $css.

◆ testMakeLoaderImplementScript()

ResourceLoaderTest::testMakeLoaderImplementScript (   $case)

◆ testMakeLoaderImplementScriptInvalid()

ResourceLoaderTest::testMakeLoaderImplementScriptInvalid ( )

ResourceLoader::makeLoaderImplementScript.

Definition at line 545 of file ResourceLoaderTest.php.

References class, and null.

◆ testMakeLoaderRegisterScript()

ResourceLoaderTest::testMakeLoaderRegisterScript ( )

◆ testMakeLoaderSourcesScript()

ResourceLoaderTest::testMakeLoaderSourcesScript ( )

◆ testMakeModuleResponseConcat()

ResourceLoaderTest::testMakeModuleResponseConcat (   $scripts,
  $expected,
  $debug,
  $message = null 
)

Verify how multiple scripts and mw.loader.state() calls are concatenated.

provideMakeModuleResponseConcat ResourceLoader::makeModuleResponse

Definition at line 803 of file ResourceLoaderTest.php.

References $context, $debug, $modules, $response, and ResourceLoaderTestCase\getResourceLoaderContext().

◆ testMakeModuleResponseEmpty()

ResourceLoaderTest::testMakeModuleResponseEmpty ( )

◆ testMakeModuleResponseError()

ResourceLoaderTest::testMakeModuleResponseError ( )

Verify that when building module content in a load.php response, an exception from one module will not break script output from other modules.

ResourceLoader::makeModuleResponse

Definition at line 845 of file ResourceLoaderTest.php.

References $context, $modules, $response, and ResourceLoaderTestCase\getResourceLoaderContext().

◆ testMakeModuleResponseErrorCSS()

ResourceLoaderTest::testMakeModuleResponseErrorCSS ( )

Verify that exceptions in PHP for one module will not break others (stylesheet response).

ResourceLoader::makeModuleResponse

Definition at line 884 of file ResourceLoaderTest.php.

References $context, $modules, $response, and ResourceLoaderTestCase\getResourceLoaderContext().

◆ testMakeModuleResponseExtraHeaders()

ResourceLoaderTest::testMakeModuleResponseExtraHeaders ( )

◆ testMakeModuleResponseExtraHeadersMulti()

◆ testMakeModuleResponseStartupError()

ResourceLoaderTest::testMakeModuleResponseStartupError ( )

Verify that when building the startup module response, an exception from one module class will not break the entire startup module response.

See T152266.

ResourceLoader::makeModuleResponse

Definition at line 922 of file ResourceLoaderTest.php.

References $context, $modules, $response, and ResourceLoaderTestCase\getResourceLoaderContext().

◆ testMakePackedModulesString()

ResourceLoaderTest::testMakePackedModulesString (   $desc,
  $modules,
  $packed 
)

◆ testMeasureResponseTime()

ResourceLoaderTest::testMeasureResponseTime ( )

◆ testRegisterDuplicate()

ResourceLoaderTest::testRegisterDuplicate ( )

ResourceLoader::register.

Definition at line 123 of file ResourceLoaderTest.php.

References $resourceLoader, class, and null.

◆ testRegisterEmptyString()

ResourceLoaderTest::testRegisterEmptyString ( )

ResourceLoader::register medium.

Definition at line 92 of file ResourceLoaderTest.php.

References $resourceLoader, and class.

◆ testRegisterInvalidName()

ResourceLoaderTest::testRegisterInvalidName ( )

ResourceLoader::register medium.

Definition at line 105 of file ResourceLoaderTest.php.

References $resourceLoader, and class.

◆ testRegisterInvalidType()

ResourceLoaderTest::testRegisterInvalidType ( )

ResourceLoader::register.

Definition at line 114 of file ResourceLoaderTest.php.

References $resourceLoader, and class.

◆ testRegisterValidArray()

ResourceLoaderTest::testRegisterValidArray ( )

◆ testRespondEmpty()

ResourceLoaderTest::testRespondEmpty ( )

◆ testRespondInternalFailures()

ResourceLoaderTest::testRespondInternalFailures ( )

◆ testRespondSimple()

ResourceLoaderTest::testRespondSimple ( )

◆ testServiceWiring()

ResourceLoaderTest::testServiceWiring ( )

Ensure the ResourceLoaderRegisterModules hook is called.

Definition at line 20 of file ResourceLoaderTest.php.

References $resourceLoader, and use.


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