You are here

protected function CodeFilterPrismUnitTestCase::filterText in Code Filter 7

Filters text through codefilter_prisms prepare and process callbacks.

Parameters

string $text: The text to filter.

array $settings: Additional settings.

Return value

string The processed text.

6 calls to CodeFilterPrismUnitTestCase::filterText()
CodeFilterPrismUnitTestCase::testCodeFilterPrism in modules/codefilter_prism/codefilter_prism.test
Checks that <code> tags are escaped and highlighted correctly.
CodeFilterPrismUnitTestCase::testCodeFilterPrismAttributes in modules/codefilter_prism/codefilter_prism.test
Tests <code class="..."> tags (with attributes).
CodeFilterPrismUnitTestCase::testContainerExpand in modules/codefilter_prism/codefilter_prism.test
Checks that CSS classes are added which JS uses for hover events.
CodeFilterPrismUnitTestCase::testInlineFilter in modules/codefilter_prism/codefilter_prism.test
Checks that <code> and <?php inline escaped and highlighted correctly.
CodeFilterPrismUnitTestCase::testPhpFilter in modules/codefilter_prism/codefilter_prism.test
Checks that <?php tags are escaped and highlighted correctly.

... See full list

File

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

Class

CodeFilterPrismUnitTestCase
Contains unit tests for codefilter_prism.module.

Code

protected function filterText($text, array $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;
}