You are here

public function PlainTextOutputTest::testRenderFromHtml in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php \Drupal\Tests\Component\Render\PlainTextOutputTest::testRenderFromHtml()

Tests ::renderFromHtml().

@covers ::renderFromHtml @dataProvider providerRenderFromHtml

Parameters

$expected: The expected formatted value.

$string: A string to be formatted.

array $args: (optional) An associative array of replacements to make. Defaults to none.

File

core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php, line 35
Contains \Drupal\Tests\Component\Render\PlainTextOutputTest.

Class

PlainTextOutputTest
@coversDefaultClass \Drupal\Component\Render\PlainTextOutput @group Utility

Namespace

Drupal\Tests\Component\Render

Code

public function testRenderFromHtml($expected, $string, $args = []) {
  $markup = SafeMarkup::format($string, $args);
  $output = PlainTextOutput::renderFromHtml($markup);
  $this
    ->assertSame($expected, $output);
}