Index: modules/comment/comment.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v
retrieving revision 1.57
diff -u -p -r1.57 comment.test
--- modules/comment/comment.test	11 Dec 2009 17:09:00 -0000	1.57
+++ modules/comment/comment.test	13 Dec 2009 02:34:47 -0000
@@ -17,15 +17,17 @@ class CommentHelperCase extends DrupalWe
   /**
    * Post comment.
    *
-   * @param object $node Node to post comment on.
-   * @param string $comment Comment body.
-   * @param string $subject Comment subject.
-   * @param mixed $contact Set to NULL for no contact info, TRUE to ignore success checking, and array of values to set contact info.
-   *
-   * This needs to be static to be invoked via CommentHelperCase::postComment()
-   * in other tests.
+   * @param $node
+   *   Node to post comment on.
+   * @param $comment
+   *   Comment body.
+   * @param $subject
+   *   Comment subject.
+   * @param $contact
+   *   Set to NULL for no contact info, TRUE to ignore success checking, and
+   *   array of values to set contact info.
    */
-  public static function postComment($node, $comment, $subject = '', $contact = NULL) {
+  function postComment($node, $comment, $subject = '', $contact = NULL) {
     $edit = array();
     $edit['comment'] = $comment;
 
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.178
diff -u -p -r1.178 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	10 Dec 2009 15:39:43 -0000	1.178
+++ modules/simpletest/drupal_web_test_case.php	13 Dec 2009 02:32:57 -0000
@@ -430,20 +430,22 @@ abstract class DrupalTestCase {
    * @see set_error_handler
    */
   public function errorHandler($severity, $message, $file = NULL, $line = NULL) {
-    $error_map = array(
-      E_STRICT => 'Run-time notice',
-      E_WARNING => 'Warning',
-      E_NOTICE => 'Notice',
-      E_CORE_ERROR => 'Core error',
-      E_CORE_WARNING => 'Core warning',
-      E_USER_ERROR => 'User error',
-      E_USER_WARNING => 'User warning',
-      E_USER_NOTICE => 'User notice',
-      E_RECOVERABLE_ERROR => 'Recoverable error',
-    );
+    if ($severity & error_reporting()) {
+      $error_map = array(
+        E_STRICT => 'Run-time notice',
+        E_WARNING => 'Warning',
+        E_NOTICE => 'Notice',
+        E_CORE_ERROR => 'Core error',
+        E_CORE_WARNING => 'Core warning',
+        E_USER_ERROR => 'User error',
+        E_USER_WARNING => 'User warning',
+        E_USER_NOTICE => 'User notice',
+        E_RECOVERABLE_ERROR => 'Recoverable error',
+      );
 
-    $backtrace = debug_backtrace();
-    $this->error($message, $error_map[$severity], _drupal_get_last_caller($backtrace));
+      $backtrace = debug_backtrace();
+      $this->error($message, $error_map[$severity], _drupal_get_last_caller($backtrace));
+    }
     return TRUE;
   }
 
@@ -536,11 +538,6 @@ class DrupalUnitTestCase extends DrupalT
     $this->originalPrefix = $db_prefix;
     $this->originalFileDirectory = file_directory_path();
 
-    // Log fatal errors.
-    ini_set('log_errors', 1);
-    // Make all errors visible.
-    error_reporting(E_ALL);
-
     // Reset all statics so that test is performed with a clean environment.
     drupal_static_reset();
 
@@ -1057,8 +1054,6 @@ class DrupalWebTestCase extends DrupalTe
     // Log fatal errors.
     ini_set('log_errors', 1);
     ini_set('error_log', $directory . '/error.log');
-    // Make all errors visible.
-    error_reporting(E_ALL);
 
     // Reset all statics so that test is performed with a clean environment.
     drupal_static_reset();
Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.71
diff -u -p -r1.71 user.test
--- modules/user/user.test	10 Dec 2009 15:39:43 -0000	1.71
+++ modules/user/user.test	13 Dec 2009 03:33:31 -0000
@@ -302,6 +302,9 @@ class UserLoginTestCase extends DrupalWe
   }
 }
 
+/**
+ * Test cancelling a user.
+ */
 class UserCancelTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
@@ -311,6 +314,10 @@ class UserCancelTestCase extends DrupalW
     );
   }
 
+  function setUp() {
+    parent::setUp('comment');
+  }
+
   /**
    * Attempt to cancel account without permission.
    */
@@ -521,7 +528,7 @@ class UserCancelTestCase extends DrupalW
     variable_set('user_cancel_method', 'user_cancel_delete');
 
     // Create a user.
-    $account = $this->drupalCreateUser(array('cancel account'));
+    $account = $this->drupalCreateUser(array('cancel account', 'post comments', 'post comments without approval'));
     $this->drupalLogin($account);
     // Load real user object.
     $account = user_load($account->uid, TRUE);
@@ -530,9 +537,16 @@ class UserCancelTestCase extends DrupalW
     $node = $this->drupalCreateNode(array('uid' => $account->uid));
 
     // Create comment.
-    module_load_include('test', 'comment');
-    $comment = CommentHelperCase::postComment($node, $this->randomName(32), '', TRUE);
-    $this->assertTrue(comment_load($comment->id), t('Comment found.'));
+    $edit = array(
+      'subject' => $this->randomString(),
+      'comment' => $this->randomString(),
+    );
+    $this->drupalPost('comment/reply/' . $node->nid, $edit, t('Preview'));
+    $this->drupalPost(NULL, array(), t('Save'));
+    $this->assertText(t('Your comment has been posted.'));
+    $comments = comment_load_multiple(array(), array('subject' => $edit['subject']));
+    $comment = reset($comments);
+    $this->assertTrue($comment->cid, t('Comment found.'));
 
     // Create a node with two revisions, the initial one belonging to the
     // cancelling user.
