function DrupalHtmlToTextTestCase::testDrupalHtmltoTextRemoveTrailingWhitespace
7.x mail.test | DrupalHtmlToTextTestCase::testDrupalHtmltoTextRemoveTrailingWhitespace() |
Tests that drupal_wrap_mail() removes trailing whitespace before newlines.
File
- drupal-7.x/
modules/ simpletest/ tests/ mail.test, line 273 - Test the Drupal mailing system.
Class
- DrupalHtmlToTextTestCase
- Unit tests for drupal_html_to_text().
Code
function testDrupalHtmltoTextRemoveTrailingWhitespace() {
$text = "Hi there! \nHerp Derp";
$mail_lines = explode("\n", drupal_wrap_mail($text));
$this->assertNotEqual(" ", substr($mail_lines[0], -1), 'Trailing whitespace removed.');
}