Issue #1798756 by andreiashu, alexpott: Fixed Finish conversion of error_level() to CMI.

8.0.x
webchick 2012-09-30 14:51:30 -04:00
parent 92a9506e63
commit 294f1790e2
2 changed files with 13 additions and 1 deletions

View File

@ -250,7 +250,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
$message = t('%type: !message in %function (line %line of %file).', $error);
// Check if verbose error reporting is on.
$error_level = variable_get('error_level', ERROR_REPORTING_DISPLAY_ALL);
$error_level = config('system.logging')->get('error_level');
if ($error_level == ERROR_REPORTING_DISPLAY_VERBOSE) {
// First trace is the error itself, already contained in the message.

View File

@ -53,6 +53,15 @@ class ErrorHandlerTest extends WebTestBase {
'%file' => drupal_get_path('module', 'error_test') . '/error_test.module',
);
// Set error reporting to display verbose notices.
config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save();
$this->drupalGet('error-test/generate-warnings');
$this->assertResponse(200, t('Received expected HTTP status code.'));
$this->assertErrorMessage($error_notice);
$this->assertErrorMessage($error_warning);
$this->assertErrorMessage($error_user_notice);
$this->assertRaw('<pre class="backtrace">', 'Found pre element with backtrace class.');
// Set error reporting to collect notices.
$config->set('error_level', ERROR_REPORTING_DISPLAY_ALL)->save();
$this->drupalGet('error-test/generate-warnings');
@ -60,6 +69,7 @@ class ErrorHandlerTest extends WebTestBase {
$this->assertErrorMessage($error_notice);
$this->assertErrorMessage($error_warning);
$this->assertErrorMessage($error_user_notice);
$this->assertNoRaw('<pre class="backtrace">', 'Did not find pre element with backtrace class.');
// Set error reporting to not collect notices.
$config->set('error_level', ERROR_REPORTING_DISPLAY_SOME)->save();
@ -68,6 +78,7 @@ class ErrorHandlerTest extends WebTestBase {
$this->assertNoErrorMessage($error_notice);
$this->assertErrorMessage($error_warning);
$this->assertErrorMessage($error_user_notice);
$this->assertNoRaw('<pre class="backtrace">', 'Did not find pre element with backtrace class.');
// Set error reporting to not show any errors.
$config->set('error_level', ERROR_REPORTING_HIDE)->save();
@ -76,6 +87,7 @@ class ErrorHandlerTest extends WebTestBase {
$this->assertNoErrorMessage($error_notice);
$this->assertNoErrorMessage($error_warning);
$this->assertNoErrorMessage($error_user_notice);
$this->assertNoRaw('<pre class="backtrace">', 'Did not find pre element with backtrace class.');
}
/**