public function HtmlToTextTest::testUsenetSignature

Tests that drupal_wrap_mail() does not remove the trailing whitespace from Usenet style signatures.

RFC 3676 says, "This is a special case; an (optionally quoted or quoted and stuffed) line consisting of DASH DASH SP is neither fixed nor flowed."

File

drupal/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php, line 380
Definition of Drupal\system\Tests\Mail\HtmlToTextTest.

Class

HtmlToTextTest
Tests for drupal_html_to_text().

Namespace

Drupal\system\Tests\Mail

Code

public function testUsenetSignature() {
  $text = "Hi there!\n-- \nHerp Derp";
  $mail_lines = explode("\n", drupal_wrap_mail($text));
  $this
    ->assertEqual("-- ", $mail_lines[1], 'Trailing whitespace not removed for dash-dash-space signatures.');
  $text = "Hi there!\n--  \nHerp Derp";
  $mail_lines = explode("\n", drupal_wrap_mail($text));
  $this
    ->assertEqual("--", $mail_lines[1], 'Trailing whitespace removed for incorrect dash-dash-space signatures.');
}