function DrupalHtmlToTextTestCase::testDrupalHtmltoTextRemoveTrailingWhitespace

Tests that drupal_wrap_mail() removes trailing whitespace before newlines.

File

modules/simpletest/tests/mail.test, line 348

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.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.