function HTMLRestrictionsTest::testConstructor

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

@covers ::__construct @dataProvider providerConstruct

File

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

Class

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

Namespace

Drupal\Tests\ckeditor5\Unit

Code

public function testConstructor(array $elements, ?string $expected_exception_message) : void {
    if ($expected_exception_message !== NULL) {
        $this->expectException(\InvalidArgumentException::class);
        $this->expectExceptionMessage($expected_exception_message);
    }
    $restrictions = new HTMLRestrictions($elements);
    $this->assertIsArray($restrictions->getAllowedElements(FALSE));
}

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