You are here

public function MinifyHtmlUnitTestCase::testMinifyHtmlPreReplacement in Minify Source HTML 7

Test Minify HTML Pre Replacement.

File

tests/minifyhtml.test, line 59

Class

MinifyHtmlUnitTestCase
Minify HTML Unit Tests.

Code

public function testMinifyHtmlPreReplacement() {
  $input = "<html>\n";
  $input .= "  <head>\n";
  $input .= "    <title>Test HTML</title>\n";
  $input .= "  </head>\n";
  $input .= "  <body>\n";
  $input .= "    <pre>\n";
  $input .= "  Indented content.\n";
  $input .= "         Weirdly Indented content.\n";
  $input .= "Non-indented content.\n";
  $input .= "</pre>\n";
  $input .= "  </body>\n";
  $input .= "</html>\n";
  $expected_output = "<html><head><title>Test HTML</title></head><body><pre>\n";
  $expected_output .= "  Indented content.\n";
  $expected_output .= "         Weirdly Indented content.\n";
  $expected_output .= "Non-indented content.\n";
  $expected_output .= "</pre></body></html>";
  $actual_output = $input;
  minifyhtml_minify($actual_output);
  $this
    ->assertEqual($expected_output, $actual_output, 'Minified source matches expected output.');
}