public function HtmlToTextTest::testRemoveTrailingWhitespace in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php \Drupal\Tests\system\Functional\Mail\HtmlToTextTest::testRemoveTrailingWhitespace()
- 10 core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php \Drupal\Tests\system\Functional\Mail\HtmlToTextTest::testRemoveTrailingWhitespace()
Tests that trailing whitespace is removed before newlines.
See also
\Drupal\Core\Mail\MailFormatHelper::wrapMail()
File
- core/
modules/ system/ tests/ src/ Functional/ Mail/ HtmlToTextTest.php, line 352
Class
Namespace
Drupal\Tests\system\Functional\MailCode
public function testRemoveTrailingWhitespace() {
$text = "Hi there! \nHerp Derp";
$mail_lines = explode("\n", MailFormatHelper::wrapMail($text));
$this
->assertNotEquals(" ", substr($mail_lines[0], -1), 'Trailing whitespace removed.');
}