Issue #2540538 by znerol: Behavior of testErrorContainer() and testExceptionContainer() is unpredictable
parent
f8629621bb
commit
e536cb07af
|
@ -18,10 +18,15 @@ class ErrorContainer extends Container {
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
|
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
|
||||||
// Enforce a recoverable error.
|
if ($id === 'http_kernel') {
|
||||||
$callable = function(ErrorContainer $container) {
|
// Enforce a recoverable error.
|
||||||
};
|
$callable = function(ErrorContainer $container) {
|
||||||
$callable(1);
|
};
|
||||||
|
$callable(1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return parent::get($id, $invalidBehavior);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,12 @@ class ExceptionContainer extends Container {
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
|
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