public function HtmlToTextTest::testDrupalHtmlToTextArgs in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Tests/Mail/HtmlToTextTest.php \Drupal\system\Tests\Mail\HtmlToTextTest::testDrupalHtmlToTextArgs()
Tests allowing tags in \Drupal\Core\Mail\MailFormatHelper::htmlToText().
File
- core/
modules/ system/ src/ Tests/ Mail/ HtmlToTextTest.php, line 169 - Contains \Drupal\system\Tests\Mail\HtmlToTextTest.
Class
Namespace
Drupal\system\Tests\MailCode
public function testDrupalHtmlToTextArgs() {
// The second parameter of \Drupal\Core\Mail\MailFormatHelper::htmlToText()
// overrules the allowed tags.
$this
->assertHtmlToText('Drupal <b>Drupal</b> Drupal', "Drupal *Drupal* Drupal\n", 'Allowed <b> tag found', array(
'b',
));
$this
->assertHtmlToText('Drupal <h1>Drupal</h1> Drupal', "Drupal Drupal Drupal\n", 'Disallowed <h1> tag not found', array(
'b',
));
$this
->assertHtmlToText('Drupal <p><em><b>Drupal</b></em><p> Drupal', "Drupal Drupal Drupal\n", 'Disallowed <p>, <em>, and <b> tags not found', array(
'a',
'br',
'h1',
));
$this
->assertHtmlToText('<html><body>Drupal</body></html>', "Drupal\n", 'Unsupported <html> and <body> tags not found', array(
'html',
'body',
));
}