function DrupalHtmlToTextTestCase::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.

4 calls to DrupalHtmlToTextTestCase::stringToHtml()
DrupalHtmlToTextTestCase::assertHtmlToText in drupal-7.x/modules/simpletest/tests/mail.test
Helper function for testing drupal_html_to_text().
DrupalHtmlToTextTestCase::assertHtmlToText in drupal-7.x/modules/simpletest/tests/mail.test
Helper function for testing drupal_html_to_text().
DrupalHtmlToTextTestCase::testDrupalHtmlToTextBlockTagToNewline in drupal-7.x/modules/simpletest/tests/mail.test
Test that text separated by block-level tags in HTML get separated by (at least) a newline in the plaintext version.
DrupalHtmlToTextTestCase::testDrupalHtmlToTextBlockTagToNewline in drupal-7.x/modules/simpletest/tests/mail.test
Test that text separated by block-level tags in HTML get separated by (at least) a newline in the plaintext version.

Archivo

drupal-7.x/modules/simpletest/tests/mail.test, line 107
Test the Drupal mailing system.

Class

DrupalHtmlToTextTestCase
Unit tests for drupal_html_to_text().

Código

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