diff --git a/core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php b/core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php index 3027b021aa..9b9582f8ee 100644 --- a/core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php +++ b/core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php @@ -605,7 +605,7 @@ public function providerOperands(): \Generator { 'union' => 'b', ]; - // Wildcard + matching tag cases. + // Wildcard tag + matching tag cases. yield 'wildcard + matching tag: attribute intersection — without possible expansion' => [ 'a' => new HTMLRestrictions(['p' => ['class' => TRUE]]), 'b' => new HTMLRestrictions(['$block' => ['class' => TRUE]]), @@ -663,7 +663,7 @@ public function providerOperands(): \Generator { 'union' => new HTMLRestrictions(['p' => ['class' => ['text-align-center' => TRUE, 'text-align-justify' => TRUE]], '$block' => ['class' => ['text-align-center' => TRUE]]]), ]; - // Wildcard + non-matching cases. + // Wildcard tag + non-matching tag cases. yield 'wildcard + non-matching tag: attribute diff — without possible expansion' => [ 'a' => new HTMLRestrictions(['span' => ['class' => TRUE]]), 'b' => new HTMLRestrictions(['$block' => ['class' => TRUE]]), @@ -721,7 +721,7 @@ public function providerOperands(): \Generator { 'union' => new HTMLRestrictions(['span' => ['class' => ['vertical-align-top' => TRUE, 'vertical-align-bottom' => TRUE]], '$block' => ['class' => ['vertical-align-top' => TRUE]]]), ]; - // Wildcard + wildcard cases. + // Wildcard tag + wildcard tag cases. yield 'wildcard + wildcard tag: attributes' => [ 'a' => new HTMLRestrictions(['$block' => ['class' => TRUE, 'foo' => TRUE]]), 'b' => new HTMLRestrictions(['$block' => ['class' => TRUE]]), @@ -750,6 +750,23 @@ public function providerOperands(): \Generator { 'intersection' => 'a', 'union' => 'b', ]; + + // Concrete attributes + Wildcard attribute cases. + yield 'concrete attrs + wildcard attr' => [ + 'a' => new HTMLRestrictions(['img' => ['data-entity-uuid' => TRUE, 'data-entity-type' => TRUE]]), + 'b' => new HTMLRestrictions(['img' => ['data-*' => TRUE]]), + 'diff' => HTMLRestrictions::emptySet(), + 'intersection' => 'a', + 'union' => 'b', + ]; + yield 'concrete attrs + wildcard attr — vice versa' => [ + 'a' => new HTMLRestrictions(['img' => ['data-*' => TRUE]]), + 'b' => new HTMLRestrictions(['img' => ['data-entity-uuid' => TRUE, 'data-entity-type' => TRUE]]), + 'diff' => 'a', + 'intersection' => 'b', + 'union' => 'a', + ]; + } }