function FilterHtmlTest::testSetConfiguration

Same name in other branches
  1. 9 core/modules/filter/tests/src/Unit/FilterHtmlTest.php \Drupal\Tests\filter\Unit\FilterHtmlTest::testSetConfiguration()
  2. 10 core/modules/filter/tests/src/Unit/FilterHtmlTest.php \Drupal\Tests\filter\Unit\FilterHtmlTest::testSetConfiguration()
  3. 11.x core/modules/filter/tests/src/Unit/FilterHtmlTest.php \Drupal\Tests\filter\Unit\FilterHtmlTest::testSetConfiguration()

@covers ::setConfiguration

File

core/modules/filter/tests/src/Unit/FilterHtmlTest.php, line 85

Class

FilterHtmlTest
@coversDefaultClass \Drupal\filter\Plugin\Filter\FilterHtml @group filter

Namespace

Drupal\Tests\filter\Unit

Code

public function testSetConfiguration() {
    $configuration['settings'] = [
        // New lines and spaces are replaced with a single space.
'allowed_html' => "<a>  <br>\r\n  <p>",
        'filter_html_help' => 1,
        'filter_html_nofollow' => 0,
    ];
    $filter = new FilterHtml($configuration, 'filter_html', [
        'provider' => 'test',
    ]);
    $this->assertSame('<a> <br> <p>', $filter->getConfiguration()['settings']['allowed_html']);
}

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