From: Timo Tijhof Date: Tue, 3 Oct 2017 17:18:49 +0000 (+0100) Subject: resourceloader: Add unit test for ClientHtml::makeLoad sync=>true X-Git-Tag: 1.31.0-rc.0~1895 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=33868f0e4667dbc7ad3dfd438436f943f9cb6d34;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php index eaae9dc4ca..f75d67d801 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php @@ -275,6 +275,12 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { 'only' => ResourceLoaderModule::TYPE_SCRIPTS, 'output' => '', ], + [ + 'context' => [ 'sync' => true ], + 'modules' => [ 'test.scripts.raw' ], + 'only' => ResourceLoaderModule::TYPE_SCRIPTS, + 'output' => '', + ], [ '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 ); }