From: Timo Tijhof Date: Thu, 29 Jun 2017 02:11:11 +0000 (-0700) Subject: resourceloader: Improve ResourceLoaderClientHtmlTest tests X-Git-Tag: 1.31.0-rc.0~2837^2 X-Git-Url: https://git.cyclocoop.org/admin/%7B%24admin_url%7Dmembres/Zigzagzogzagzig?a=commitdiff_plain;h=c55aae02d0428ee24121c09f22b05e1ebc3957b9;p=lhc%2Fweb%2Fwiklou.git resourceloader: Improve ResourceLoaderClientHtmlTest tests The example for a mixed user module is outdated. Current user modules all separate styles and scripts. To make the effective change by the next commit easier to review, update these tests first seperately. Change-Id: I76a8a96eed8a8c39863c535362b1d0144ef2f866 --- diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php index cef4a293f9..979da44245 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php @@ -46,15 +46,29 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { 'test.styles.pure' => [ 'type' => ResourceLoaderModule::LOAD_STYLES ], 'test.styles.mixed' => [], - 'test.styles.noscript' => [ 'group' => 'noscript', 'type' => ResourceLoaderModule::LOAD_STYLES ], - 'test.styles.mixed.user' => [ 'group' => 'user' ], - 'test.styles.mixed.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ], - 'test.styles.private' => [ 'group' => 'private', 'styles' => '.private{}' ], + 'test.styles.noscript' => [ + 'type' => ResourceLoaderModule::LOAD_STYLES, + 'group' => 'noscript', + ], + 'test.styles.user' => [ + 'type' => ResourceLoaderModule::LOAD_STYLES, + 'group' => 'user', + ], + 'test.styles.user.empty' => [ + 'type' => ResourceLoaderModule::LOAD_STYLES, + 'group' => 'user', + 'isKnownEmpty' => true, + ], + 'test.styles.private' => [ + 'type' => ResourceLoaderModule::LOAD_STYLES, + 'group' => 'private', + 'styles' => '.private{}', + ], 'test.scripts' => [], 'test.scripts.top' => [ 'position' => 'top' ], - 'test.scripts.mixed.user' => [ 'group' => 'user' ], - 'test.scripts.mixed.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ], + 'test.scripts.user' => [ 'group' => 'user' ], + 'test.scripts.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ], 'test.scripts.raw' => [ 'isRaw' => true ], ]; return array_map( function ( $options ) { @@ -92,14 +106,14 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { ] ); $client->setModuleStyles( [ 'test.styles.mixed', - 'test.styles.mixed.user.empty', + 'test.styles.user.empty', 'test.styles.private', 'test.styles.pure', 'test.unregistered.styles', ] ); $client->setModuleScripts( [ 'test.scripts', - 'test.scripts.mixed.user.empty', + 'test.scripts.user.empty', 'test.scripts.top', 'test.unregistered.scripts', ] ); @@ -109,11 +123,11 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { 'test.private.top' => 'loading', 'test.private.bottom' => 'loading', 'test.styles.pure' => 'ready', - 'test.styles.mixed.user.empty' => 'ready', + 'test.styles.user.empty' => 'ready', 'test.styles.private' => 'ready', 'test.scripts' => 'loading', 'test.scripts.top' => 'loading', - 'test.scripts.mixed.user.empty' => 'ready', + 'test.scripts.user.empty' => 'ready', ], 'general' => [ 'test', @@ -240,9 +254,9 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { ], [ 'context' => [], - 'modules' => [ 'test.scripts.mixed.user' ], + 'modules' => [ 'test.scripts.user' ], 'only' => ResourceLoaderModule::TYPE_SCRIPTS, - 'output' => '', + 'output' => '', ], [ 'context' => [ 'debug' => true ],