Issue #2540538 by znerol: Behavior of testErrorContainer() and testExceptionContainer() is unpredictable
parent
f8629621bb
commit
e536cb07af
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue