function HTMLRestrictionsTest::testConstructor

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

Tests constructor.

@legacy-covers ::__construct

Attributes

#[DataProvider('providerConstruct')]

File

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

Class

HTMLRestrictionsTest
Tests Drupal\ckeditor5\HTMLRestrictions.

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.