You are here

public function FilterHtmlTest::testSetConfiguration in Drupal 8

Same name and namespace in other branches
  1. 9 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']);
}