Index: filter_example/filter_example.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/examples/filter_example/filter_example.module,v
retrieving revision 1.6
diff -u -p -r1.6 filter_example.module
--- filter_example/filter_example.module	10 Feb 2010 06:41:08 -0000	1.6
+++ filter_example/filter_example.module	7 Mar 2010 00:37:40 -0000
@@ -142,13 +142,15 @@ function _filter_example_filter_foo_tips
  */
 
 /*
- * time filter prepare callback
+ * Time filter prepare callback
  *
- * We'll use the bytes  \xEF\xA3\xBF and \xEF\xA3\xBE to replace < and > here.
- * These bytes are not valid in UTF-8 data and thus unlikely to cause problems.
+ * We'll use [filter-example-time] as a replacement for the time tag.
+ * Note that in a more complicated filter a closing tag may also be
+ * required. For more information, see "Temporary placeholders and
+ * delimiters" at http://drupal.org/node/209715.
  */
 function _filter_example_filter_time_prepare($text, $filter) {
-  return preg_replace('!<time ?/>!', "\xEF\xA3\xBFtime /\xEF\xA3\xBE", $text);
+  return preg_replace('!<time ?/>!', '[filter-example-time]', $text);
 }
 
 /*
@@ -158,7 +160,7 @@ function _filter_example_filter_time_pre
  * to the real filtering.
  */
 function _filter_example_filter_time_process($text, $filter) {
-  return str_replace("\xEF\xA3\xBFtime /\xEF\xA3\xBE", '<em>' . format_date(time()) . '</em>', $text);
+  return str_replace('[filter-example-time]', '<em>' . format_date(time()) . '</em>', $text);
 }
 
 
@@ -172,4 +174,4 @@ function _filter_example_filter_time_pro
  */
 function _filter_example_filter_time_tips($filter, $format, $long = FALSE) {
   return t('<em>&lt;time /&gt;</em> is replaced with the current time.');
-}
\ No newline at end of file
+}
Index: filter_example/filter_example.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/examples/filter_example/filter_example.test,v
retrieving revision 1.2
diff -u -p -r1.2 filter_example.test
--- filter_example/filter_example.test	4 Feb 2010 15:24:32 -0000	1.2
+++ filter_example/filter_example.test	7 Mar 2010 00:37:40 -0000
@@ -26,7 +26,14 @@ class FilterExampleTestCase extends Drup
   function setUp() {
     parent::setUp('filter_example');
     // Create user.
-    $this->web_user = $this->drupalCreateUser(array('administer filters', 'use text format 1', 'use text format 2', 'bypass node access'));
+    $filtered_html_format = db_query_range('SELECT * FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Filtered HTML'))->fetchObject();
+    $full_html_format = db_query_range('SELECT * FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Full HTML'))->fetchObject();
+    $this->web_user = $this->drupalCreateUser(array(
+      'administer filters',
+      filter_permission_name($filtered_html_format),
+      filter_permission_name($full_html_format),
+      'bypass node access',
+    ));
   }
 
   /**
