diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-03-07 00:21:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 00:21:17 +0300 |
commit | d25af6d0a0db467ffd4d4e58540906e554483879 (patch) | |
tree | d78cdd5e0781f32048fc863f84565f8efdc48635 /tests | |
parent | 27faa3d8c008c97556a3ef27decd706d34b79a1a (diff) |
Fix regression in plugin order determination, new param keepUnresolved is not used in function. (#18886)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Integration/AssetManager/UIAssetFetcher/PluginUmdAssetFetcherTest.php | 20 |
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); |