Issue #3156885 by andypost, Gábor Hojtsy: Change \Drupal\error_test\Controller\ErrorTestController::generateWarnings() to throw E_NOTICE error compatible with PHP 8
parent
11118a3416
commit
9e3b13b6fb
|
@ -44,7 +44,8 @@ class ErrorTestController extends ControllerBase {
|
|||
// Tell Drupal error reporter to send errors to Simpletest or not.
|
||||
define('SIMPLETEST_COLLECT_ERRORS', $collect_errors);
|
||||
// This will generate a notice.
|
||||
$monkey_love = $bananas;
|
||||
$bananas = [];
|
||||
$monkey_love = $bananas[1];
|
||||
// This will generate a warning.
|
||||
$awesomely_big = 1 / 0;
|
||||
// This will generate a user error. Use & to check for double escaping.
|
||||
|
|
|
@ -31,7 +31,7 @@ class ErrorHandlerTest extends BrowserTestBase {
|
|||
$config = $this->config('system.logging');
|
||||
$error_notice = [
|
||||
'%type' => 'Notice',
|
||||
'@message' => 'Undefined variable: bananas',
|
||||
'@message' => 'Undefined offset: 1',
|
||||
'%function' => 'Drupal\error_test\Controller\ErrorTestController->generateWarnings()',
|
||||
'%file' => drupal_get_path('module', 'error_test') . '/error_test.module',
|
||||
];
|
||||
|
|
|
@ -111,7 +111,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
|
|||
public function testUncaughtFatalError() {
|
||||
$fatal_error = [
|
||||
'%type' => 'TypeError',
|
||||
'@message' => 'Argument 1 passed to Drupal\error_test\Controller\ErrorTestController::Drupal\error_test\Controller\{closure}() must be of the type array, string given, called in ' . \Drupal::root() . '/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php on line 62',
|
||||
'@message' => 'Argument 1 passed to Drupal\error_test\Controller\ErrorTestController::Drupal\error_test\Controller\{closure}() must be of the type array, string given, called in ' . \Drupal::root() . '/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php on line 63',
|
||||
'%function' => 'Drupal\error_test\Controller\ErrorTestController->Drupal\error_test\Controller\{closure}()',
|
||||
];
|
||||
$this->drupalGet('error-test/generate-fatals');
|
||||
|
|
Loading…
Reference in New Issue