protected function HtmlToTextTest::stringToHtml in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php \Drupal\Tests\system\Functional\Mail\HtmlToTextTest::stringToHtml()
- 9 core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php \Drupal\Tests\system\Functional\Mail\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.
File
- core/
modules/ system/ tests/ src/ Functional/ Mail/ HtmlToTextTest.php, line 32
Class
Namespace
Drupal\Tests\system\Functional\MailCode
protected function stringToHtml($text) {
return '"' . str_replace([
"\n",
' ',
], [
'\\n',
' ',
], Html::escape($text)) . '"';
}