8000 Catch exceptions from kernel->getContainer() (#26) · SymfonyTest/symfony-bundle-test@531b653 · GitHub
[go: up one dir, main page]

Skip to content

Commit 531b653

Browse files
authored
Catch exceptions from kernel->getContainer() (#26)
1 parent ce3ad79 commit 531b653

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/BaseBundleTestCase.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ protected function createKernel()
8080
public function ensureKernelShutdown()
8181
{
8282
if (null !== $this->kernel) {
83-
$container = $this->kernel->getContainer();
83+
try {
84+
$container = $this->kernel->getContainer();
85+
} catch (\LogicException $e) {
86+
$container = null;
87+
}
8488
$this->kernel->shutdown();
8589
if ($container instanceof ResettableContainerInterface) {
8690
$container->reset();

0 commit comments

Comments
 (0)
0