summaryrefslogtreecommitdiff
path: root/modules/simpletest/drupal_web_test_case.php
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-12-13 09:14:21 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-12-13 09:14:21 +0000
commitd6305a6616d4e9275ae61e82334285e9fb156a62 (patch)
tree80cefb8c62932263b2471fae8e3aae038680a1d8 /modules/simpletest/drupal_web_test_case.php
parenta542d8b716b050d35bef3f367fb925b027bce409 (diff)
downloadbrdo-d6305a6616d4e9275ae61e82334285e9fb156a62.tar.gz
brdo-d6305a6616d4e9275ae61e82334285e9fb156a62.tar.bz2
#653940 follow-up by carlos8f and sun: Fix fatal errors in tests and revert changes to error reporting in previous patch.
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r--modules/simpletest/drupal_web_test_case.php35
1 files changed, 15 insertions, 20 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 09c192376..646eb64b4 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -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 DrupalTestCase {
$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 DrupalTestCase {
// 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();