Skip to content
Snippets Groups Projects
Commit a5fec26d authored by Antonio De Marco's avatar Antonio De Marco
Browse files

Issue #120: Fix tests.

parent 2af570a7
Branches
Tags
No related merge requests found
......@@ -104,17 +104,19 @@ abstract class PatternBase extends PluginBase implements PatternInterface, Conta
* Item parent set in previous recursive iteration, if any.
*/
protected function processLibraries(&$libraries, $base_path, $parent = '') {
$parents = ['js', 'base', 'layout', 'component', 'state', 'theme'];
$_libraries = $libraries;
foreach ($_libraries as $name => $values) {
$is_asset = in_array($parent, $parents, TRUE);
$is_external = isset($values['type']) && $values['type'] == 'external';
if ($is_asset && !$is_external) {
$libraries[$base_path . DIRECTORY_SEPARATOR . $name] = $values;
unset($libraries[$name]);
}
elseif (!$is_asset && ($parent != 'dependencies')) {
$this->processLibraries($libraries[$name], $base_path, $name);
if (!is_string($libraries)) {
$parents = ['js', 'base', 'layout', 'component', 'state', 'theme'];
$_libraries = $libraries;
foreach ($_libraries as $name => $values) {
$is_asset = in_array($parent, $parents, TRUE);
$is_external = isset($values['type']) && $values['type'] == 'external';
if ($is_asset && !$is_external) {
$libraries[$base_path . DIRECTORY_SEPARATOR . $name] = $values;
unset($libraries[$name]);
}
elseif (!$is_asset) {
$this->processLibraries($libraries[$name], $base_path, $name);
}
}
}
}
......
......@@ -73,7 +73,6 @@
http://example.com/external.min.js: { type: external, minified: true }
/pattern/base/path/library_two.js: {}
-
actual:
id: pattern_name
......@@ -82,7 +81,6 @@
- drupal/library_two
expected: []
-
actual:
id: pattern_name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment