Verified Commit d5fe4c87 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3553601 by grimreaper, gxleano: Icon API: Allow dot in library

(cherry picked from commit adddba60)
parent 5f334b94
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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\\.-]*$"
    }
  }
}
+2 −1
Original line number Diff line number Diff line
@@ -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],
@@ -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);
      }
    }