Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.307
diff -u -p -r1.307 filter.module
--- modules/filter/filter.module	7 Dec 2009 03:46:36 -0000	1.307
+++ modules/filter/filter.module	8 Dec 2009 04:16:51 -0000
@@ -825,10 +825,12 @@ function _filter_tips($format_id, $long 
  *   A DOMDocument that represents the loaded (X)HTML snippet.
  */
 function filter_dom_load($text) {
-  // Ignore warnings during HTML soup loading.
-  $dom_document = @DOMDocument::loadHTML('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>' . $text . '</body></html>');
+  // DOM can load HTML soup. But, HTML soup can throw warnings, suppress
+  // them.
+  $document = new DOMDocument();
+  @$document->loadHTML('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>' . $text . '</body></html>');
 
-  return $dom_document;
+  return $document;
 }
 
 /**
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.177
diff -u -p -r1.177 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	6 Dec 2009 18:06:22 -0000	1.177
+++ modules/simpletest/drupal_web_test_case.php	8 Dec 2009 04:17:11 -0000
@@ -424,29 +424,26 @@ abstract class DrupalTestCase {
   }
 
   /**
-   * Handle errors.
+   * Handle errors during test runs.
    *
    * Because this is registered in set_error_handler(), it has to be public.
    * @see set_error_handler
-   *
    */
   public function errorHandler($severity, $message, $file = NULL, $line = NULL) {
-    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',
-      );
+    $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;
   }
 
@@ -539,6 +536,12 @@ class DrupalUnitTestCase extends DrupalT
     $this->originalPrefix = $db_prefix;
     $this->originalFileDirectory = file_directory_path();
 
+    // 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();
 
@@ -1055,6 +1058,8 @@ 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();
@@ -1359,12 +1364,13 @@ class DrupalWebTestCase extends DrupalTe
     if (!$this->elements) {
       // DOM can load HTML soup. But, HTML soup can throw warnings, suppress
       // them.
-      @$htmlDom = DOMDocument::loadHTML($this->content);
-      if ($htmlDom) {
+      $document = new DOMDocument();
+      $result = @$document->loadHTML($this->content);
+      if ($result) {
         $this->pass(t('Valid HTML found on "@path"', array('@path' => $this->getUrl())), t('Browser'));
         // It's much easier to work with simplexml than DOM, luckily enough
         // we can just simply import our DOM tree.
-        $this->elements = simplexml_import_dom($htmlDom);
+        $this->elements = simplexml_import_dom($document);
       }
     }
     if (!$this->elements) {
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.857
diff -u -p -r1.857 system.module
--- modules/system/system.module	6 Dec 2009 01:00:27 -0000	1.857
+++ modules/system/system.module	8 Dec 2009 01:50:56 -0000
@@ -2130,6 +2130,7 @@ function _system_rebuild_module_data() {
 
   // Include the install profile in modules that are loaded.
   $profile = drupal_get_profile();
+  $modules[$profile] = new stdClass;
   $modules[$profile]->name = $profile;
   $modules[$profile]->uri = 'profiles/' . $profile . '/' . $profile . '.profile';
   $modules[$profile]->filename = $profile . '.profile';
