function HTMLRestrictionsTest::providerCounting

Same name in other branches
  1. 10 core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php \Drupal\Tests\ckeditor5\Unit\HTMLRestrictionsTest::providerCounting()
  2. 11.x core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php \Drupal\Tests\ckeditor5\Unit\HTMLRestrictionsTest::providerCounting()

File

core/modules/ckeditor5/tests/src/Unit/HTMLRestrictionsTest.php, line 169

Class

HTMLRestrictionsTest
@coversDefaultClass \Drupal\ckeditor5\HTMLRestrictions @group ckeditor5

Namespace

Drupal\Tests\ckeditor5\Unit

Code

public 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.