You are here

public function CodeFilterPrismUnitTestCase::testPhpFilterWithMarkup in Code Filter 7

Checks that <?php tags are escaped and highlighted correctly with markup.

File

modules/codefilter_prism/codefilter_prism.test, line 87
Unit tests for codefilter_prism.module.

Class

CodeFilterPrismUnitTestCase
Contains unit tests for codefilter_prism.module.

Code

public function testPhpFilterWithMarkup() {
  $input = <<<EOD
<?php
return '<p>' . \$result . '</p>';
?>
EOD;
  $expected = <<<EOD
<pre class="codeblock"><code class="language-php">return &#039;&lt;p&gt;&#039; . \$result . &#039;&lt;/p&gt;&#039;;
</code></pre>
EOD;
  $result = $this
    ->filterText($input);
  $this
    ->assertIdentical($expected, $result);
}