Skip to content
Snippets Groups Projects
Commit e536cb07 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2540538 by znerol: Behavior of testErrorContainer() and...

Issue #2540538 by znerol: Behavior of testErrorContainer() and testExceptionContainer() is unpredictable
parent f8629621
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -18,10 +18,15 @@ class ErrorContainer extends Container {
* {@inheritdoc}
*/
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
// Enforce a recoverable error.
$callable = function(ErrorContainer $container) {
};
$callable(1);
if ($id === 'http_kernel') {
// Enforce a recoverable error.
$callable = function(ErrorContainer $container) {
};
$callable(1);
}
else {
return parent::get($id, $invalidBehavior);
}
}
}
......@@ -18,7 +18,12 @@ class ExceptionContainer extends Container {
* {@inheritdoc}
*/
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
throw new \Exception('Thrown exception during Container::get');
if ($id === 'http_kernel') {
throw new \Exception('Thrown exception during Container::get');
}
else {
return parent::get($id, $invalidBehavior);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment