resourceloader: Add unit test for ClientHtml::makeLoad sync=>true
Used by Special:JavaScriptTest, and we may need to use this in OutputPage as well (for html5shiv). Change-Id: If7d7c12056dc3aab78486050f0798d42b158d9a9
This commit is contained in:
parent
d4a17a10a5
commit
33868f0e46
1 changed files with 7 additions and 1 deletions
|
|
@ -275,6 +275,12 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase {
|
|||
'only' => ResourceLoaderModule::TYPE_SCRIPTS,
|
||||
'output' => '<script async="" src="/w/load.php?debug=false&lang=nl&modules=test.scripts.raw&only=scripts&skin=fallback"></script>',
|
||||
],
|
||||
[
|
||||
'context' => [ 'sync' => true ],
|
||||
'modules' => [ 'test.scripts.raw' ],
|
||||
'only' => ResourceLoaderModule::TYPE_SCRIPTS,
|
||||
'output' => '<script src="/w/load.php?debug=false&lang=nl&modules=test.scripts.raw&only=scripts&skin=fallback&sync=1"></script>',
|
||||
],
|
||||
[
|
||||
'context' => [],
|
||||
'modules' => [ 'test.scripts.user' ],
|
||||
|
|
@ -360,7 +366,7 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase {
|
|||
public function testMakeLoad( array $extraQuery, array $modules, $type, $expected ) {
|
||||
$context = self::makeContext( $extraQuery );
|
||||
$context->getResourceLoader()->register( self::makeSampleModules() );
|
||||
$actual = ResourceLoaderClientHtml::makeLoad( $context, $modules, $type );
|
||||
$actual = ResourceLoaderClientHtml::makeLoad( $context, $modules, $type, $extraQuery );
|
||||
$expected = self::expandVariables( $expected );
|
||||
$this->assertEquals( $expected, (string)$actual );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue