Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.39
diff -u -p -r1.39 common.test
--- modules/simpletest/tests/common.test	21 May 2009 21:12:24 -0000	1.39
+++ modules/simpletest/tests/common.test	22 May 2009 02:40:35 -0000
@@ -628,119 +628,6 @@ class DrupalRenderUnitTestCase extends D
   }
 }
 
-
-/**
- * Tests Drupal error and exception handlers.
- */
-class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
-  public static function getInfo() {
-    return array(
-      'name' => t('Drupal error handlers'),
-      'description' => t('Performs tests on the Drupal error and exception handler.'),
-      'group' => t('System'),
-    );
-  }
-
-  function setUp() {
-    parent::setUp('system_test');
-  }
-
-  /**
-   * Test the error handler.
-   */
-  function testErrorHandler() {
-    $error_notice = array(
-      '%type' => 'Notice',
-      '%message' => 'Undefined variable: bananas',
-      '%function' => 'system_test_generate_warnings()',
-      '%line' => 194,
-      '%file' => realpath('modules/simpletest/tests/system_test.module'),
-    );
-    $error_warning = array(
-      '%type' => 'Warning',
-      '%message' => 'Division by zero',
-      '%function' => 'system_test_generate_warnings()',
-      '%line' => 196,
-      '%file' => realpath('modules/simpletest/tests/system_test.module'),
-    );
-    $error_user_notice = array(
-      '%type' => 'User notice',
-      '%message' => 'Drupal is awesome',
-      '%function' => 'system_test_generate_warnings()',
-      '%line' => 198,
-      '%file' => realpath('modules/simpletest/tests/system_test.module'),
-    );
-
-    // Set error reporting to collect notices.
-    variable_set('error_level', ERROR_REPORTING_DISPLAY_ALL);
-    $this->drupalGet('system-test/generate-warnings');
-    $this->assertErrorMessage($error_notice);
-    $this->assertErrorMessage($error_warning);
-    $this->assertErrorMessage($error_user_notice);
-
-    // Set error reporting to not collect notices.
-    variable_set('error_level', ERROR_REPORTING_DISPLAY_SOME);
-    $this->drupalGet('system-test/generate-warnings');
-    $this->assertNoErrorMessage($error_notice);
-    $this->assertErrorMessage($error_warning);
-    $this->assertErrorMessage($error_user_notice);
-
-    // Set error reporting to not show any errors.
-    variable_set('error_level', ERROR_REPORTING_HIDE);
-    $this->drupalGet('system-test/generate-warnings');
-    $this->assertNoErrorMessage($error_notice);
-    $this->assertNoErrorMessage($error_warning);
-    $this->assertNoErrorMessage($error_user_notice);
-  }
-
-  /**
-   * Test the exception handler.
-   */
-  function testExceptionHandler() {
-    $error_exception = array(
-      '%type' => 'Exception',
-      '%message' => 'Drupal is awesome',
-      '%function' => 'system_test_trigger_exception()',
-      '%line' => 207,
-      '%file' => realpath('modules/simpletest/tests/system_test.module'),
-    );
-    $error_pdo_exception = array(
-      '%type' => 'PDOException',
-      '%message' => 'SQLSTATE',
-      '%function' => 'system_test_trigger_pdo_exception()',
-      '%line' => 215,
-      '%file' => realpath('modules/simpletest/tests/system_test.module'),
-    );
-
-    $this->drupalGet('system-test/trigger-exception');
-    $this->assertErrorMessage($error_exception);
-
-    $this->drupalGet('system-test/trigger-pdo-exception');
-    // We cannot use assertErrorMessage() since the extact error reported
-    // varies from database to database. Check for the error keyword 'SQLSTATE'.
-    $this->assertText($error_pdo_exception['%type'], t('Found %type in error page.', $error_pdo_exception));
-    $this->assertText($error_pdo_exception['%message'], t('Found %message in error page.', $error_pdo_exception));
-    $error_details = t('in %function (line %line of %file)', $error_pdo_exception);
-    $this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details)));
-  }
-
-  /**
-   * Helper function: assert that the error message is found.
-   */
-  function assertErrorMessage(array $error) {
-    $message = t('%type: %message in %function (line %line of %file).', $error);
-    $this->assertRaw($message, t('Error !message found.', array('!message' => $message)));
-  }
-
-  /**
-   * Helper function: assert that the error message is not found.
-   */
-  function assertNoErrorMessage(array $error) {
-    $message = t('%type: %message in %function (line %line of %file).', $error);
-    $this->assertNoRaw($message, t('Error !message not found.', array('!message' => $message)));
-  }
-}
-
 /**
  * Test for valid_url().
  */
Index: modules/simpletest/tests/error.test
===================================================================
RCS file: modules/simpletest/tests/error.test
diff -N modules/simpletest/tests/error.test
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/error.test	22 May 2009 02:17:30 -0000
@@ -0,0 +1,115 @@
+<?php
+// $Id: error.test,v 1.39 2009/05/21 21:12:24 dries Exp $
+
+/**
+ * Tests Drupal error and exception handlers.
+ */
+class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => t('Drupal error handlers'),
+      'description' => t('Performs tests on the Drupal error and exception handler.'),
+      'group' => t('System'),
+    );
+  }
+
+  function setUp() {
+    parent::setUp('error_test');
+  }
+
+  /**
+   * Test the error handler.
+   */
+  function testErrorHandler() {
+    $error_notice = array(
+      '%type' => 'Notice',
+      '%message' => 'Undefined variable: bananas',
+      '%function' => 'error_test_generate_warnings()',
+      '%line' => 44,
+      '%file' => realpath('modules/simpletest/tests/error_test.module'),
+    );
+    $error_warning = array(
+      '%type' => 'Warning',
+      '%message' => 'Division by zero',
+      '%function' => 'error_test_generate_warnings()',
+      '%line' => 46,
+      '%file' => realpath('modules/simpletest/tests/error_test.module'),
+    );
+    $error_user_notice = array(
+      '%type' => 'User notice',
+      '%message' => 'Drupal is awesome',
+      '%function' => 'error_test_generate_warnings()',
+      '%line' => 48,
+      '%file' => realpath('modules/simpletest/tests/error_test.module'),
+    );
+
+    // Set error reporting to collect notices.
+    variable_set('error_level', ERROR_REPORTING_DISPLAY_ALL);
+    $this->drupalGet('error-test/generate-warnings');
+    $this->assertErrorMessage($error_notice);
+    $this->assertErrorMessage($error_warning);
+    $this->assertErrorMessage($error_user_notice);
+
+    // Set error reporting to not collect notices.
+    variable_set('error_level', ERROR_REPORTING_DISPLAY_SOME);
+    $this->drupalGet('error-test/generate-warnings');
+    $this->assertNoErrorMessage($error_notice);
+    $this->assertErrorMessage($error_warning);
+    $this->assertErrorMessage($error_user_notice);
+
+    // Set error reporting to not show any errors.
+    variable_set('error_level', ERROR_REPORTING_HIDE);
+    $this->drupalGet('error-test/generate-warnings');
+    $this->assertNoErrorMessage($error_notice);
+    $this->assertNoErrorMessage($error_warning);
+    $this->assertNoErrorMessage($error_user_notice);
+  }
+
+  /**
+   * Test the exception handler.
+   */
+  function testExceptionHandler() {
+    $error_exception = array(
+      '%type' => 'Exception',
+      '%message' => 'Drupal is awesome',
+      '%function' => 'error_test_trigger_exception()',
+      '%line' => 57,
+      '%file' => realpath('modules/simpletest/tests/error_test.module'),
+    );
+    $error_pdo_exception = array(
+      '%type' => 'PDOException',
+      '%message' => 'SQLSTATE',
+      '%function' => 'error_test_trigger_pdo_exception()',
+      '%line' => 65,
+      '%file' => realpath('modules/simpletest/tests/error_test.module'),
+    );
+
+    $this->drupalGet('error-test/trigger-exception');
+    $this->assertErrorMessage($error_exception);
+
+    $this->drupalGet('error-test/trigger-pdo-exception');
+    // We cannot use assertErrorMessage() since the extact error reported
+    // varies from database to database. Check for the error keyword 'SQLSTATE'.
+    $this->assertText($error_pdo_exception['%type'], t('Found %type in error page.', $error_pdo_exception));
+    $this->assertText($error_pdo_exception['%message'], t('Found %message in error page.', $error_pdo_exception));
+    $error_details = t('in %function (line %line of %file)', $error_pdo_exception);
+    $this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details)));
+  }
+
+  /**
+   * Helper function: assert that the error message is found.
+   */
+  function assertErrorMessage(array $error) {
+    $message = t('%type: %message in %function (line %line of %file).', $error);
+    $this->assertRaw($message, t('Error !message found.', array('!message' => $message)));
+  }
+
+  /**
+   * Helper function: assert that the error message is not found.
+   */
+  function assertNoErrorMessage(array $error) {
+    $message = t('%type: %message in %function (line %line of %file).', $error);
+    $this->assertNoRaw($message, t('Error !message not found.', array('!message' => $message)));
+  }
+}
+
Index: modules/simpletest/tests/error_test.info
===================================================================
RCS file: modules/simpletest/tests/error_test.info
diff -N modules/simpletest/tests/error_test.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/error_test.info	22 May 2009 02:11:10 -0000
@@ -0,0 +1,8 @@
+; $Id: session_test.info,v 1.1 2008/08/16 21:11:02 dries Exp $
+name = "Error test"
+description = "Support module for error and exception testing."
+package = Testing
+version = VERSION
+core = 7.x
+files[] = error_test.module
+hidden = TRUE
Index: modules/simpletest/tests/error_test.module
===================================================================
RCS file: modules/simpletest/tests/error_test.module
diff -N modules/simpletest/tests/error_test.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/error_test.module	22 May 2009 02:10:42 -0000
@@ -0,0 +1,66 @@
+<?php
+// $Id: session_test.module,v 1.6 2009/01/26 14:08:43 dries Exp $
+
+/**
+ * Implementation of hook_menu().
+ */
+function error_test_menu() {
+  $items['error-test/generate-warnings'] = array(
+    'title' => 'Generate warnings',
+    'page callback' => 'system_test_generate_warnings',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+  $items['error-test/generate-warnings-with-report'] = array(
+    'title' => 'Generate warnings with Simpletest reporting',
+    'page callback' => 'system_test_generate_warnings',
+    'page arguments' => array(TRUE),
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+  $items['error-test/trigger-exception'] = array(
+    'title' => 'Trigger an exception',
+    'page callback' => 'system_test_trigger_exception',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+  $items['error-test/trigger-pdo-exception'] = array(
+    'title' => 'Trigger a PDO exception',
+    'page callback' => 'system_test_trigger_pdo_exception',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+
+  return $items;
+}
+
+/**
+ * Menu callback; generate warnings to test the error handler.
+ */
+function error_test_generate_warnings($collect_errors = FALSE) {
+  // Tell Drupal error reporter to send errors to Simpletest or not.
+  define('SIMPLETEST_COLLECT_ERRORS', $collect_errors);
+  // This will generate a notice.
+  $monkey_love = $bananas;
+  // This will generate a warning.
+  $awesomely_big = 1/0;
+  // This will generate a user error.
+  trigger_error("Drupal is awesome", E_USER_NOTICE);
+  return "";
+}
+
+/**
+ * Menu callback; trigger an exception to test the exception handler.
+ */
+function error_test_trigger_exception() {
+  define('SIMPLETEST_COLLECT_ERRORS', FALSE);
+  throw new Exception("Drupal is awesome");
+}
+
+/**
+ * Menu callback; trigger an exception to test the exception handler.
+ */
+function error_test_trigger_pdo_exception() {
+  define('SIMPLETEST_COLLECT_ERRORS', FALSE);
+  db_query("SELECT * FROM bananas_are_awesome");
+}
Index: modules/simpletest/tests/system_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/system_test.module,v
retrieving revision 1.9
diff -u -p -r1.9 system_test.module
--- modules/simpletest/tests/system_test.module	22 Apr 2009 09:45:03 -0000	1.9
+++ modules/simpletest/tests/system_test.module	22 May 2009 02:42:20 -0000
@@ -53,35 +53,6 @@ function system_test_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  $items['system-test/generate-warnings'] = array(
-    'title' => 'Generate warnings',
-    'page callback' => 'system_test_generate_warnings',
-    'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
-  );
-
-  $items['system-test/generate-warnings-with-report'] = array(
-    'title' => 'Generate warnings with Simpletest reporting',
-    'page callback' => 'system_test_generate_warnings',
-    'page arguments' => array(TRUE),
-    'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
-  );
-
-  $items['system-test/trigger-exception'] = array(
-    'title' => 'Trigger an exception',
-    'page callback' => 'system_test_trigger_exception',
-    'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
-  );
-
-  $items['system-test/trigger-pdo-exception'] = array(
-    'title' => 'Trigger a PDO exception',
-    'page callback' => 'system_test_trigger_pdo_exception',
-    'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
-  );
-
   return $items;
 }
 
@@ -184,33 +155,3 @@ function system_test_exit() {
   watchdog('system_test', 'hook_exit');
 }
 
-/**
- * Menu callback; generate warnings to test the error handler.
- */
-function system_test_generate_warnings($collect_errors = FALSE) {
-  // Tell Drupal error reporter to send errors to Simpletest or not.
-  define('SIMPLETEST_COLLECT_ERRORS', $collect_errors);
-  // This will generate a notice.
-  $monkey_love = $bananas;
-  // This will generate a warning.
-  $awesomely_big = 1/0;
-  // This will generate a user error.
-  trigger_error("Drupal is awesome", E_USER_NOTICE);
-  return "";
-}
-
-/**
- * Menu callback; trigger an exception to test the exception handler.
- */
-function system_test_trigger_exception() {
-  define('SIMPLETEST_COLLECT_ERRORS', FALSE);
-  throw new Exception("Drupal is awesome");
-}
-
-/**
- * Menu callback; trigger an exception to test the exception handler.
- */
-function system_test_trigger_pdo_exception() {
-  define('SIMPLETEST_COLLECT_ERRORS', FALSE);
-  db_query("SELECT * FROM bananas_are_awesome");
-}
