Commit df91ebe3 authored by xjm's avatar xjm
Browse files

Issue #3177557 by alexpott, andypost, dawehner:...

Issue #3177557 by alexpott, andypost, dawehner: \Drupal\error_test\Controller\ErrorTestController::generateWarnings() notice is not a notice in PHP 8

(cherry picked from commit d678245f)
parent 3582dc24
...@@ -44,8 +44,8 @@ public function generateWarnings($collect_errors = FALSE) { ...@@ -44,8 +44,8 @@ public function generateWarnings($collect_errors = FALSE) {
// Tell Drupal error reporter to send errors to Simpletest or not. // Tell Drupal error reporter to send errors to Simpletest or not.
define('SIMPLETEST_COLLECT_ERRORS', $collect_errors); define('SIMPLETEST_COLLECT_ERRORS', $collect_errors);
// This will generate a notice. // This will generate a notice.
$bananas = []; $notice = new \stdClass();
$monkey_love = $bananas[1]; $notice == 1 ? 1 : 0;
// This will generate a warning. // This will generate a warning.
$awesomely_big = 1 / 0; $awesomely_big = 1 / 0;
// This will generate a user error. Use & to check for double escaping. // This will generate a user error. Use & to check for double escaping.
......
...@@ -31,7 +31,7 @@ public function testErrorHandler() { ...@@ -31,7 +31,7 @@ public function testErrorHandler() {
$config = $this->config('system.logging'); $config = $this->config('system.logging');
$error_notice = [ $error_notice = [
'%type' => 'Notice', '%type' => 'Notice',
'@message' => 'Undefined offset: 1', '@message' => 'Object of class stdClass could not be converted to int',
'%function' => 'Drupal\error_test\Controller\ErrorTestController->generateWarnings()', '%function' => 'Drupal\error_test\Controller\ErrorTestController->generateWarnings()',
'%file' => drupal_get_path('module', 'error_test') . '/error_test.module', '%file' => drupal_get_path('module', 'error_test') . '/error_test.module',
]; ];
......
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