Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2022-03-07 00:21:17 +0300
committerGitHub <noreply@github.com>2022-03-07 00:21:17 +0300
commitd25af6d0a0db467ffd4d4e58540906e554483879 (patch)
treed78cdd5e0781f32048fc863f84565f8efdc48635 /tests/PHPUnit
parent27faa3d8c008c97556a3ef27decd706d34b79a1a (diff)
Fix regression in plugin order determination, new param keepUnresolved is not used in function. (#18886)
Diffstat (limited to 'tests/PHPUnit')
-rw-r--r--tests/PHPUnit/Integration/AssetManager/UIAssetFetcher/PluginUmdAssetFetcherTest.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/AssetManager/UIAssetFetcher/PluginUmdAssetFetcherTest.php b/tests/PHPUnit/Integration/AssetManager/UIAssetFetcher/PluginUmdAssetFetcherTest.php
index 1346fa4bf1..f14708ba49 100644
--- a/tests/PHPUnit/Integration/AssetManager/UIAssetFetcher/PluginUmdAssetFetcherTest.php
+++ b/tests/PHPUnit/Integration/AssetManager/UIAssetFetcher/PluginUmdAssetFetcherTest.php
@@ -315,6 +315,26 @@ class PluginUmdAssetFetcherTest extends UnitTestCase
$this->assertEquals($expectedAssets, $assets);
}
+ public function test_orderPluginsByPluginDependencies()
+ {
+ $pluginList = PluginUmdAssetFetcher::orderPluginsByPluginDependencies([
+ 'TestPlugin4',
+ 'TestPlugin1',
+ 'TestPlugin2',
+ ]);
+ $this->assertEquals(['TestPlugin4', 'TestPlugin1', 'TestPlugin2'], $pluginList);
+ }
+
+ public function test_orderPluginsByPluginDependencies_whenKeepUnresolvedIsFalse()
+ {
+ $pluginList = PluginUmdAssetFetcher::orderPluginsByPluginDependencies([
+ 'TestPlugin4',
+ 'TestPlugin1',
+ 'TestPlugin2',
+ ], $keepUnresolved = false);
+ $this->assertEquals(['TestPlugin1', 'TestPlugin2'], $pluginList);
+ }
+
private static function getUmdFile(string $pluginName)
{
$relativeRoot = str_replace(PIWIK_INCLUDE_PATH, '', self::TEST_PLUGINS_DIR);