You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'@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 and defined',
49
-
];
50
-
if (version_compare(PHP_VERSION, '7.0.0-dev') >= 0) {
51
-
// In PHP 7, instead of a recoverable fatal error we get a TypeError.
52
-
$fatal_error['%type'] = 'TypeError';
53
-
// The error message also changes in PHP 7.
54
-
$fatal_error['@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';
55
-
}
56
45
57
46
// Set error reporting to display verbose notices.
$this->assertResponse(500, 'Received expected HTTP status code.');
73
-
$this->assertErrorMessage($fatal_error);
74
-
$this->assertRaw('<pre class="backtrace">', 'Found pre element with backtrace class.');
75
-
// Ensure we are escaping but not double escaping.
76
-
$this->assertRaw(''');
77
-
$this->assertNoRaw('&#039;');
78
-
79
-
// Remove the recoverable fatal error from the assertions, it's wanted here.
80
-
// Ensure that we just remove this one recoverable fatal error (in PHP 7 this
81
-
// is a TypeError).
82
-
foreach ($this->assertionsas$key => $assertion) {
83
-
if (in_array($assertion['message_group'], ['Recoverable fatal error', 'TypeError']) && strpos($assertion['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') !== FALSE) {
'@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 and defined',
if (version_compare(PHP_VERSION, '7.0.0-dev') >= 0) {
113
+
// In PHP 7, instead of a recoverable fatal error we get a TypeError.
114
+
$fatal_error['%type'] = 'TypeError';
115
+
// The error message also changes in PHP 7.
116
+
$fatal_error['@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';
117
+
}
118
+
$this->drupalGet('error-test/generate-fatals');
119
+
$this->assertResponse(500, 'Received expected HTTP status code.');
120
+
$message = newFormattableMarkup('%type: @message in %function (line ', $fatal_error);
121
+
$this->assertRaw((string) $message);
122
+
$this->assertRaw('<pre class="backtrace">');
123
+
// Ensure we are escaping but not double escaping.
124
+
$this->assertRaw(''');
125
+
$this->assertNoRaw('&#039;');
126
+
}
127
+
102
128
/**
103
129
* Tests uncaught exception handling with custom exception handler.
0 commit comments