protected function HtmlToTextTest::stringToHtml

Converts a string to its PHP source equivalent for display in test messages.

Parameters

$text: The text string to convert.

Return value

An HTML representation of the text string that, when displayed in a browser, represents the PHP source code equivalent of $text.

2 calls to HtmlToTextTest::stringToHtml()
HtmlToTextTest::assertHtmlToText in drupal/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
Helper function for testing drupal_html_to_text().
HtmlToTextTest::testDrupalHtmlToTextBlockTagToNewline in drupal/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
Test that text separated by block-level tags in HTML get separated by (at least) a newline in the plaintext version.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php, line 34
Definition of Drupal\system\Tests\Mail\HtmlToTextTest.

Class

HtmlToTextTest
Tests for drupal_html_to_text().

Namespace

Drupal\system\Tests\Mail

Code

protected function stringToHtml($text) {
  return '"' . str_replace(array(
    "\n",
    ' ',
  ), array(
    '\\n',
    ' ',
  ), check_plain($text)) . '"';
}