function HTMLRestrictionsTest::providerSubsets
Same name in other branches
- 10 core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php \Drupal\Tests\ckeditor5\Unit\HTMLRestrictionsTest::providerSubsets()
- 11.x core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php \Drupal\Tests\ckeditor5\Unit\HTMLRestrictionsTest::providerSubsets()
File
-
core/
modules/ ckeditor5/ tests/ src/ Unit/ HTMLRestrictionsTest.php, line 1507
Class
- HTMLRestrictionsTest
- @coversDefaultClass \Drupal\ckeditor5\HTMLRestrictions @group ckeditor5
Namespace
Drupal\Tests\ckeditor5\UnitCode
public function providerSubsets() : \Generator {
(yield 'empty set' => [
new HTMLRestrictions([]),
new HTMLRestrictions([]),
new HTMLRestrictions([]),
new HTMLRestrictions([]),
new HTMLRestrictions([]),
]);
(yield 'without wildcards' => [
new HTMLRestrictions([
'div' => FALSE,
]),
new HTMLRestrictions([]),
new HTMLRestrictions([
'div' => FALSE,
]),
new HTMLRestrictions([
'div' => FALSE,
]),
new HTMLRestrictions([
'div' => FALSE,
]),
]);
(yield 'without wildcards with attributes' => [
new HTMLRestrictions([
'div' => [
'foo' => [
'bar' => TRUE,
],
],
]),
new HTMLRestrictions([]),
new HTMLRestrictions([
'div' => [
'foo' => [
'bar' => TRUE,
],
],
]),
new HTMLRestrictions([]),
new HTMLRestrictions([
'div' => FALSE,
]),
]);
(yield 'with wildcards' => [
new HTMLRestrictions([
'div' => FALSE,
'$text-container' => [
'data-llama' => TRUE,
],
'*' => [
'on*' => FALSE,
'dir' => [
'ltr' => TRUE,
'rtl' => TRUE,
],
],
]),
new HTMLRestrictions([
'$text-container' => [
'data-llama' => TRUE,
],
]),
new HTMLRestrictions([
'div' => FALSE,
'*' => [
'on*' => FALSE,
'dir' => [
'ltr' => TRUE,
'rtl' => TRUE,
],
],
]),
new HTMLRestrictions([
'div' => FALSE,
]),
new HTMLRestrictions([
'div' => FALSE,
]),
]);
(yield 'wildcards and global attribute tag' => [
new HTMLRestrictions([
'$text-container' => [
'data-llama' => TRUE,
],
'*' => [
'on*' => FALSE,
'dir' => [
'ltr' => TRUE,
'rtl' => TRUE,
],
],
]),
new HTMLRestrictions([
'$text-container' => [
'data-llama' => TRUE,
],
]),
new HTMLRestrictions([
'*' => [
'on*' => FALSE,
'dir' => [
'ltr' => TRUE,
'rtl' => TRUE,
],
],
]),
new HTMLRestrictions([]),
new HTMLRestrictions([]),
]);
(yield 'only wildcards' => [
new HTMLRestrictions([
'$text-container' => [
'data-llama' => TRUE,
],
]),
new HTMLRestrictions([
'$text-container' => [
'data-llama' => TRUE,
],
]),
new HTMLRestrictions([]),
new HTMLRestrictions([]),
new HTMLRestrictions([]),
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.