function HTMLRestrictionsTest::testCounting

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

@covers ::allowsNothing @covers ::getAllowedElements @dataProvider providerCounting

File

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

Class

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

Namespace

Drupal\Tests\ckeditor5\Unit

Code

public function testCounting(array $elements, bool $expected_is_empty, int $expected_concrete_only_count, int $expected_concrete_plus_wildcard_count) : void {
    $r = new HTMLRestrictions($elements);
    $this->assertSame($expected_is_empty, $r->allowsNothing());
    $this->assertCount($expected_concrete_only_count, $r->getAllowedElements());
    $this->assertCount($expected_concrete_only_count, $r->getAllowedElements(TRUE));
    $this->assertCount($expected_concrete_plus_wildcard_count, $r->getAllowedElements(FALSE));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.