You are here

protected function CodeFilterUnitTestCase::filterText in Code Filter 7

Filters text through codefilters prepare and process callbacks.

Parameters

string $text: The text to filter.

Return value

string The processed text.

4 calls to CodeFilterUnitTestCase::filterText()
CodeFilterUnitTestCase::testCodeFilter in ./codefilter.test
Checks that <code> tags are escaped and highlighted correctly.
CodeFilterUnitTestCase::testCodeFilterAttributes in ./codefilter.test
Tests <code class="..."> tags (with attributes).
CodeFilterUnitTestCase::testContainerExpand in ./codefilter.test
Checks that CSS classes are added which JS uses for hover events.
CodeFilterUnitTestCase::testPhpFilter in ./codefilter.test
Checks that <?php tags are escaped and highlighted correctly.

File

./codefilter.test, line 46
Functional and unit tests for codefilter.module.

Class

CodeFilterUnitTestCase
Contains unit tests for codefilter.module.

Code

protected function filterText($text, $settings = array()) {
  $filter =& $this->filter['codefilter'];

  // Set up a dummy format using defaults.
  $format = new stdClass();
  $format->settings = array_merge($filter['default settings'], $settings);
  $text = call_user_func($filter['prepare callback'], $text, $format);
  $text = call_user_func($filter['process callback'], $text, $format);
  return $text;
}