function DrupalHtmlToTextTestCase::testDrupalHtmltoTextRemoveTrailingWhitespace in Drupal 7
Tests that drupal_wrap_mail() removes trailing whitespace before newlines.
File
- modules/
simpletest/ tests/ mail.test, line 348 - 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.');
}