resourceloader: Add test for non-empty user module in scripts-only queue
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 5 Mar 2018 22:41:29 +0000 (14:41 -0800)
committerLegoktm <legoktm@member.fsf.org>
Mon, 5 Mar 2018 23:37:31 +0000 (23:37 +0000)
The getData() tests did have a test case for a 'user' group module with
isKnownEmpty in the script-only queue, but not yet a non-empty one.

The makeLoad() tests did have both already. Arguably the makeLoad()
tests are higher level and observe its behaviour already (outputting
a script tag means 'loading', outputting nothing means 'ready'),
but adding it to the getData() tests for consistency.

Bug: T188689
Change-Id: I842febf996ba8bb0ea25b5ca3b5ac4503db87376

tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php

index 7bfd769..a75ea56 100644 (file)
@@ -127,6 +127,7 @@ class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase {
                ] );
                $client->setModuleScripts( [
                        'test.scripts',
+                       'test.scripts.user',
                        'test.scripts.user.empty',
                        'test.scripts.shouldembed',
                        'test.unregistered.scripts',
@@ -142,6 +143,7 @@ class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase {
                                'test.styles.private' => 'ready',
                                'test.styles.shouldembed' => 'ready',
                                'test.scripts' => 'loading',
+                               'test.scripts.user' => 'loading',
                                'test.scripts.user.empty' => 'ready',
                                'test.scripts.shouldembed' => 'loading',
                        ],
@@ -153,6 +155,7 @@ class ResourceLoaderClientHtmlTest extends PHPUnit\Framework\TestCase {
                        ],
                        'scripts' => [
                                'test.scripts',
+                               'test.scripts.user',
                                'test.scripts.shouldembed',
                        ],
                        'embed' => [