drupal core updated to 7.28
This commit is contained in:
@@ -267,6 +267,31 @@ class DrupalHtmlToTextTestCase extends DrupalWebTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that drupal_wrap_mail() removes trailing whitespace before newlines.
|
||||
*/
|
||||
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.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests drupal_wrap_mail() retains 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."
|
||||
*/
|
||||
function testDrupalHtmltoTextUsenetSignature() {
|
||||
$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.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that whitespace is collapsed.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user