From 14d19eb90a9502734dac3bbbf527b3f4ff675846 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Mon, 12 Feb 2018 22:00:15 +0100 Subject: [PATCH] resourceloader: Removed tests for deprecated 'position' parameter This parameter is a no-op for these tests, as such, nothing was being tested by specifying it in tests. The behaviour 'test' and 'test.top' was identical. Bug: T184257 Change-Id: Ia2bb731f00d4b4175f7b75174aeafaca9412329e --- tests/phpunit/ResourceLoaderTestCase.php | 4 -- .../ResourceLoaderClientHtmlTest.php | 37 +++++++------------ tests/qunit/QUnitTestResources.php | 1 - 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/tests/phpunit/ResourceLoaderTestCase.php b/tests/phpunit/ResourceLoaderTestCase.php index 97198627ed..514150c755 100644 --- a/tests/phpunit/ResourceLoaderTestCase.php +++ b/tests/phpunit/ResourceLoaderTestCase.php @@ -87,7 +87,6 @@ class ResourceLoaderTestModule extends ResourceLoaderModule { protected $dependencies = []; protected $group = null; protected $source = 'local'; - protected $position = 'bottom'; protected $script = ''; protected $styles = ''; protected $skipFunction = null; @@ -126,9 +125,6 @@ class ResourceLoaderTestModule extends ResourceLoaderModule { public function getSource() { return $this->source; } - public function getPosition() { - return $this->position; - } public function getType() { return $this->type; diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php index c83f5004db..e51d0d6252 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php @@ -42,9 +42,7 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { protected static function makeSampleModules() { $modules = [ 'test' => [], - 'test.top' => [ 'position' => 'top' ], - 'test.private.top' => [ 'group' => 'private', 'position' => 'top' ], - 'test.private.bottom' => [ 'group' => 'private', 'position' => 'bottom' ], + 'test.private' => [ 'group' => 'private' ], 'test.shouldembed.empty' => [ 'shouldEmbed' => true, 'isKnownEmpty' => true ], 'test.shouldembed' => [ 'shouldEmbed' => true ], @@ -75,7 +73,6 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { ], 'test.scripts' => [], - 'test.scripts.top' => [ 'position' => 'top' ], 'test.scripts.user' => [ 'group' => 'user' ], 'test.scripts.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ], 'test.scripts.raw' => [ 'isRaw' => true ], @@ -115,9 +112,7 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { $client = new ResourceLoaderClientHtml( $context ); $client->setModules( [ 'test', - 'test.private.bottom', - 'test.private.top', - 'test.top', + 'test.private', 'test.shouldembed.empty', 'test.shouldembed', 'test.unregistered', @@ -133,15 +128,13 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { $client->setModuleScripts( [ 'test.scripts', 'test.scripts.user.empty', - 'test.scripts.top', 'test.scripts.shouldembed', 'test.unregistered.scripts', ] ); $expected = [ 'states' => [ - 'test.private.top' => 'loading', - 'test.private.bottom' => 'loading', + 'test.private' => 'loading', 'test.shouldembed.empty' => 'ready', 'test.shouldembed' => 'loading', 'test.styles.pure' => 'ready', @@ -149,27 +142,23 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { 'test.styles.private' => 'ready', 'test.styles.shouldembed' => 'ready', 'test.scripts' => 'loading', - 'test.scripts.top' => 'loading', 'test.scripts.user.empty' => 'ready', 'test.scripts.shouldembed' => 'loading', ], 'general' => [ 'test', - 'test.top', ], 'styles' => [ 'test.styles.pure', ], 'scripts' => [ 'test.scripts', - 'test.scripts.top', 'test.scripts.shouldembed', ], 'embed' => [ 'styles' => [ 'test.styles.private', 'test.styles.shouldembed' ], 'general' => [ - 'test.private.bottom', - 'test.private.top', + 'test.private', 'test.shouldembed', ], ], @@ -193,15 +182,15 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { $client = new ResourceLoaderClientHtml( $context ); $client->setConfig( [ 'key' => 'value' ] ); $client->setModules( [ - 'test.top', - 'test.private.top', + 'test', + 'test.private', ] ); $client->setModuleStyles( [ 'test.styles.pure', 'test.styles.private', ] ); $client->setModuleScripts( [ - 'test.scripts.top', + 'test.scripts', ] ); $client->setExemptStates( [ 'test.exempt' => 'ready', @@ -211,10 +200,10 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { $expected = '' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" @@ -266,9 +255,9 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase { ], [ 'context' => [], - 'modules' => [ 'test.private.top' ], + 'modules' => [ 'test.private' ], 'only' => ResourceLoaderModule::TYPE_COMBINED, - 'output' => '', + 'output' => '', ], [ 'context' => [], diff --git a/tests/qunit/QUnitTestResources.php b/tests/qunit/QUnitTestResources.php index b168754bf8..8390ab3c58 100644 --- a/tests/qunit/QUnitTestResources.php +++ b/tests/qunit/QUnitTestResources.php @@ -33,7 +33,6 @@ return [ 'mediawiki.page.startup', 'test.sinonjs', ], - 'position' => 'top', 'targets' => [ 'desktop', 'mobile' ], ], -- 2.20.1