X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fresourceloader%2FResourceLoaderClientHtmlTest.php;h=c83f5004dba838745151e1bc444e17140ac7868b;hb=8a95833baed3b8071fcbd8cd2bc8c3449409f665;hp=eaae9dc4ca024d761a2228ba8bc2facae808cf14;hpb=8029a97549bd12a9111f7d7c3e54cc8ecf07f94b;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php index eaae9dc4ca..c83f5004db 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php @@ -7,6 +7,8 @@ use Wikimedia\TestingAccessWrapper; */ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { + use MediaWikiCoversValidator; + protected static function expandVariables( $text ) { return strtr( $text, [ '{blankVer}' => ResourceLoaderTestCase::BLANK_VERSION @@ -205,7 +207,7 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { 'test.exempt' => 'ready', ] ); - // @codingStandardsIgnoreStart Generic.Files.LineLength + // phpcs:disable Generic.Files.LineLength $expected = '' . "\n" . ''; - // @codingStandardsIgnoreEnd + // phpcs:enable $expected = self::expandVariables( $expected ); $this->assertEquals( $expected, $client->getHeadHtml() ); @@ -248,8 +250,8 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { } public static function provideMakeLoad() { + // phpcs:disable Generic.Files.LineLength return [ - // @codingStandardsIgnoreStart Generic.Files.LineLength [ 'context' => [], 'modules' => [ 'test.unknown' ], @@ -275,6 +277,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' ], @@ -341,8 +349,8 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { . '' . "\n" . '' ], - // @codingStandardsIgnoreEnd ]; + // phpcs:enable } /** @@ -360,7 +368,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 ); }