File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
src/Symfony/Bundle/FrameworkBundle Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,12 @@ protected function doRequest($request)
117
117
// avoid shutting down the Kernel if no request has been performed yet
118
118
// WebTestCase::createClient() boots the Kernel but do not handle a request
119
119
if ($ this ->hasPerformedRequest && $ this ->reboot ) {
120
- $ container = $ this ->kernel ->getContainer ();
120
+ try {
121
+ $ container = $ this ->kernel ->getContainer ();
122
+ } catch (\LogicException $ e ) {
123
+ $ container = null ;
124
+ }
125
+
121
126
$ this ->kernel ->shutdown ();
122
127
123
128
if ($ container instanceof ResetInterface) {
Original file line number Diff line number Diff line change @@ -51,6 +51,16 @@ public function testEnableRebootKernel()
51
51
$ client ->request ('GET ' , '/ ' );
52
52
}
53
53
54
+ public function testRequestAfterKernelShutdownAndPerformedRequest ()
55
+ {
56
+ $ this ->expectNotToPerformAssertions ();
57
+
58
+ $ client = static ::createClient (['test_case ' => 'TestServiceContainer ' ]);
59
+ $ client ->request ('GET ' , '/ ' );
60
+ static ::ensureKernelShutdown ();
61
+ $ client ->request ('GET ' , '/ ' );
62
+ }
63
+
54
64
private function getKernelMock ()
55
65
{
56
66
$ mock = $ this ->getMockBuilder ($ this ->getKernelClass ())
You can’t perform that action at this time.
0 commit comments