Browse Source

adjust IconCollection to work with new config structure (#279)

* adjust IconCollection to work with new config structure

* fix CS
Kevin Pfeifer 3 years ago
parent
commit
db6547b2a9

+ 1 - 1
src/View/Icon/IconCollection.php

@@ -55,7 +55,7 @@ class IconCollection {
 	public function names(): array {
 		$names = [];
 		foreach ($this->iconSets as $name => $set) {
-			$path = $this->_config['paths'][$name] ?? null;
+			$path = $this->_config['config'][$name]['path'] ?? null;
 			if ($path === null) {
 				continue;
 			}

+ 7 - 3
tests/TestCase/View/Icon/IconCollectionTest.php

@@ -19,9 +19,13 @@ class IconCollectionTest extends TestCase {
 				'material' => MaterialIcon::class,
 			],
 			// For being able to parse the available icons
-			'paths' => [
-				'feather' => TEST_FILES . 'font_icon/feather/icons.json',
-				'material' => TEST_FILES . 'font_icon/material/index.d.ts',
+			'config' => [
+				'feather' => [
+					'path' => TEST_FILES . 'font_icon/feather/icons.json',
+				],
+				'material' => [
+					'path' => TEST_FILES . 'font_icon/material/index.d.ts',
+				],
 			],
 		];
 		$result = (new IconCollection($config))->names();