Commit 294f1790 authored by webchick's avatar webchick

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

parent 92a9506e
......@@ -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.
......
......@@ -53,6 +53,15 @@ function testErrorHandler() {
'%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 @@ function testErrorHandler() {
$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 @@ function testErrorHandler() {
$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 @@ function testErrorHandler() {
$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.');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment