You are here

public function HtmlToTextTest::testRemoveTrailingWhitespace in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Mail/HtmlToTextTest.php \Drupal\system\Tests\Mail\HtmlToTextTest::testRemoveTrailingWhitespace()

Tests that trailing whitespace is removed before newlines.

See also

\Drupal\Core\Mail\MailFormatHelper::wrapMail()

File

core/modules/system/src/Tests/Mail/HtmlToTextTest.php, line 368
Contains \Drupal\system\Tests\Mail\HtmlToTextTest.

Class

HtmlToTextTest
Tests for \Drupal\Core\Mail\MailFormatHelper::htmlToText().

Namespace

Drupal\system\Tests\Mail

Code

public function testRemoveTrailingWhitespace() {
  $text = "Hi there! \nHerp Derp";
  $mail_lines = explode("\n", MailFormatHelper::wrapMail($text));
  $this
    ->assertNotEqual(" ", substr($mail_lines[0], -1), 'Trailing whitespace removed.');
}