You are here

public function HtmlToTextTest::testDrupalHtmltoTextCollapsesWhitespace 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::testDrupalHtmltoTextCollapsesWhitespace()

Test that whitespace is collapsed.

File

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

Class

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

Namespace

Drupal\system\Tests\Mail

Code

public function testDrupalHtmltoTextCollapsesWhitespace() {
  $input = "<p>Drupal  Drupal\n\nDrupal<pre>Drupal  Drupal\n\nDrupal</pre>Drupal  Drupal\n\nDrupal</p>";

  // @todo The whitespace should be collapsed.
  $collapsed = "Drupal  Drupal\n\nDrupalDrupal  Drupal\n\nDrupalDrupal  Drupal\n\nDrupal\n\n";
  $this
    ->assertHtmlToText($input, $collapsed, 'Whitespace is collapsed', array(
    'p',
  ));
}