diff options
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/filter_test.module | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/simpletest/tests/filter_test.module b/modules/simpletest/tests/filter_test.module index 691d2231f..01a69315b 100644 --- a/modules/simpletest/tests/filter_test.module +++ b/modules/simpletest/tests/filter_test.module @@ -36,6 +36,28 @@ function filter_test_filter_info() { 'description' => 'Does nothing, but makes a text format uncacheable.', 'cache' => FALSE, ); + $filters['filter_test_replace'] = array( + 'title' => 'Testing filter', + 'description' => 'Replaces all content with filter and text format information.', + 'process callback' => 'filter_test_replace', + ); return $filters; } +/** + * Process handler for filter_test_replace filter. + * + * Replaces all text with filter and text format information. + */ +function filter_test_replace($text, $filter, $format, $langcode, $cache, $cache_id) { + $text = array(); + $text[] = 'Filter: ' . $filter->title . ' (' . $filter->name . ')'; + $text[] = 'Format: ' . $format->name . ' (' . $format->format . ')'; + $text[] = 'Language: ' . $langcode; + $text[] = 'Cache: ' . ($cache ? 'Enabled' : 'Disabled'); + if ($cache_id) { + $text[] = 'Cache ID: ' . $cache_id; + } + return implode("<br />\n", $text); +} + |