function HTMLRestrictionsTest::providerCounting
Provides data to testCounting().
File
- 
              core/
modules/ ckeditor5/ tests/ src/ Unit/ HTMLRestrictionsTest.php, line 184  
Class
Namespace
Drupal\Tests\ckeditor5\UnitCode
public static function providerCounting() : \Generator {
  yield 'empty' => [
    [],
    TRUE,
    0,
    0,
  ];
  yield 'one concrete tag' => [
    [
      'a' => TRUE,
    ],
    FALSE,
    1,
    1,
  ];
  yield 'one wildcard tag: considered to allow nothing because no concrete tag to resolve onto' => [
    [
      '$text-container' => [
        'class' => [
          'text-align-left' => TRUE,
        ],
      ],
    ],
    FALSE,
    0,
    1,
  ];
  yield 'two concrete tags' => [
    [
      'a' => TRUE,
      'b' => FALSE,
    ],
    FALSE,
    2,
    2,
  ];
  yield 'one concrete tag, one wildcard tag' => [
    [
      'a' => TRUE,
      '$text-container' => [
        'class' => [
          'text-align-left' => TRUE,
        ],
      ],
    ],
    FALSE,
    1,
    2,
  ];
  yield 'only globally allowed attribute: considered to allow something' => [
    [
      '*' => [
        'lang' => TRUE,
      ],
    ],
    FALSE,
    1,
    1,
  ];
  yield 'only globally forbidden attribute: considered to allow nothing' => [
    [
      '*' => [
        'style' => FALSE,
      ],
    ],
    TRUE,
    1,
    1,
  ];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.