Loading core/assets/schemas/v1/icon_pack.schema.json +2 −2 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ "title": "Asset library", "description": "The ID of an asset library", "type": "string", "pattern": "^\\w+/[A-Za-z]+[\\w-]*$" "pattern": "^\\w+/[A-Za-z]+[\\w\\.-]*$" } } } core/tests/Drupal/Tests/Core/Theme/Icon/IconPackManagerTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ class IconPackManagerTest extends UnitTestCase { public static function providerIconPackLibraryName(): array { return [ 'valid name with underscore' => ['my_theme/my_library', TRUE], 'valid name with dot' => ['my_theme/my.library', TRUE], 'valid name with hyphen' => ['my_theme/my-library', TRUE], 'valid name with hyphen and numbers' => ['my_theme/my-long-library_with_mixed-hyphens123', TRUE], 'invalid theme name case 1' => ['my-theme/my-library', FALSE], Loading Loading @@ -98,7 +99,7 @@ public function testIconPackLibraryName(string $name, bool $is_valid): void { } catch (\Exception $e) { if (!$is_valid) { $this->assertSame('icon_test:foo Error in definition `foo`:[library] Does not match the regex pattern ^\w+/[A-Za-z]+[\w-]*$', $e->getMessage()); $this->assertSame('icon_test:foo Error in definition `foo`:[library] Does not match the regex pattern ^\w+/[A-Za-z]+[\w\.-]*$', $e->getMessage()); $this->assertInstanceOf(IconPackConfigErrorException::class, $e); } } Loading Loading
core/assets/schemas/v1/icon_pack.schema.json +2 −2 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ "title": "Asset library", "description": "The ID of an asset library", "type": "string", "pattern": "^\\w+/[A-Za-z]+[\\w-]*$" "pattern": "^\\w+/[A-Za-z]+[\\w\\.-]*$" } } }
core/tests/Drupal/Tests/Core/Theme/Icon/IconPackManagerTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ class IconPackManagerTest extends UnitTestCase { public static function providerIconPackLibraryName(): array { return [ 'valid name with underscore' => ['my_theme/my_library', TRUE], 'valid name with dot' => ['my_theme/my.library', TRUE], 'valid name with hyphen' => ['my_theme/my-library', TRUE], 'valid name with hyphen and numbers' => ['my_theme/my-long-library_with_mixed-hyphens123', TRUE], 'invalid theme name case 1' => ['my-theme/my-library', FALSE], Loading Loading @@ -98,7 +99,7 @@ public function testIconPackLibraryName(string $name, bool $is_valid): void { } catch (\Exception $e) { if (!$is_valid) { $this->assertSame('icon_test:foo Error in definition `foo`:[library] Does not match the regex pattern ^\w+/[A-Za-z]+[\w-]*$', $e->getMessage()); $this->assertSame('icon_test:foo Error in definition `foo`:[library] Does not match the regex pattern ^\w+/[A-Za-z]+[\w\.-]*$', $e->getMessage()); $this->assertInstanceOf(IconPackConfigErrorException::class, $e); } } Loading