Index: modules/simpletest/simpletest.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v
retrieving revision 1.60
diff -u -r1.60 simpletest.module
--- modules/simpletest/simpletest.module	7 Jul 2009 08:07:24 -0000	1.60
+++ modules/simpletest/simpletest.module	10 Jul 2009 20:21:43 -0000
@@ -233,10 +233,10 @@
           'line' => $match[3],
           'file' => $match[2],
         );
-        DrupalTestCase::assertStatic($test_id, $test_class, FALSE, $match[1], 'Fatal error', $caller);
+        DrupalTestCase::insertAssert($test_id, $test_class, FALSE, $match[1], 'Fatal error', $caller);
       }
       else {
-        DrupalTestCase::assertStatic($test_id, $test_class, FALSE, $line, 'Fatal error');
+        DrupalTestCase::insertAssert($test_id, $test_class, FALSE, $line, 'Fatal error');
       }
     }
   }
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.123
diff -u -r1.123 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	8 Jul 2009 07:23:23 -0000	1.123
+++ modules/simpletest/drupal_web_test_case.php	10 Jul 2009 20:21:43 -0000
@@ -138,11 +138,18 @@
   }
 
   /**
-   * Make assertions from outside the test case.
+   * Store an assertion from outside the testing context.
+   *
+   * This is useful for inserting assertions that can only be recorded after
+   * the test case has been destroyed, such as PHP fatal errors. The caller
+   * information is not automatically gathered since the caller is most likely
+   * inserting the assertion on behalf of other code. In all other respects
+   * the method behaves just like DrupalTestCase::assert() in terms of storing
+   * the assertion.
    *
    * @see DrupalTestCase::assert()
    */
-  public static function assertStatic($test_id, $test_class, $status, $message = '', $group = 'Other', array $caller = NULL) {
+  public static function insertAssert($test_id, $test_class, $status, $message = '', $group = 'Other', array $caller = NULL) {
     // Convert boolean status to string status.
     if (is_bool($status)) {
       $status = $status ? 'pass' : 'fail';
Index: includes/database/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/database.inc,v
retrieving revision 1.60
diff -u -r1.60 database.inc
--- includes/database/database.inc	7 Jul 2009 08:57:48 -0000	1.60
+++ includes/database/database.inc	10 Jul 2009 20:21:43 -0000
@@ -1348,8 +1348,12 @@
 
       // We need to pass around the simpletest database prefix in the request
       // and we put that in the user_agent header.
-      if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/^simpletest\d+$/", $_SERVER['HTTP_USER_AGENT'])) {     
+      if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/^simpletest\d+$/", $_SERVER['HTTP_USER_AGENT'])) {
         $db_prefix .= $_SERVER['HTTP_USER_AGENT'];
+
+        // Log fatal errors.
+        ini_set('log_errors', 1);
+        ini_set('error_log', $directory . '/error.log');
       }
       return $new_connection;
     }
@@ -2438,7 +2442,7 @@
 function db_ignore_slave() {
   $connection_info = Database::getConnectionInfo();
   // Only set ignore_slave_server if there are slave servers
-  // being used, which is assumed if there are more than one.    
+  // being used, which is assumed if there are more than one.
   if (count($connection_info) > 1) {
     // Five minutes is long enough to allow the slave to break and resume
     // interrupted replication without causing problems on the Drupal site
