File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -85,17 +85,25 @@ public function getContainer()
8585 */
8686 public function getKernel ()
8787 {
88- if (null === self ::$ kernel ) {
89- $ kernel = parent ::bootKernel ();
90- if ($ kernel instanceof KernelInterface) {
91- self ::$ kernel = $ kernel ;
88+ if (null === static ::$ kernel ) {
89+ parent ::bootKernel (static ::getKernelConfiguration ());
90+ }
91+
92+ if (static ::$ kernel instanceof KernelInterface) {
93+ $ kernelEnvironment = static ::$ kernel ->getEnvironment ();
94+ $ expectedEnvironment = isset ($ this ->getKernelConfiguration ()['environment ' ])
95+ ? $ this ->getKernelConfiguration ()['environment ' ]
96+ : 'phpcr ' ;
97+ if ($ kernelEnvironment !== $ expectedEnvironment ) {
98+ parent ::bootKernel (static ::getKernelConfiguration ());
9299 }
93100 }
94- if (!self ::$ kernel ->getContainer ()) {
95- self ::$ kernel ->boot ();
101+
102+ if (!static ::$ kernel ->getContainer ()) {
103+ static ::$ kernel ->boot ();
96104 }
97105
98- return self ::$ kernel ;
106+ return static ::$ kernel ;
99107 }
100108
101109 /**
Original file line number Diff line number Diff line change @@ -18,15 +18,15 @@ class TestTestCase extends BaseTestCase
1818{
1919 public function setKernel (KernelInterface $ kernel )
2020 {
21- self ::$ kernel = $ kernel ;
21+ static ::$ kernel = $ kernel ;
2222 }
2323
2424 protected static function createKernel (array $ options = [])
2525 {
26- if (null === self ::$ kernel ) {
26+ if (null === static ::$ kernel ) {
2727 return parent ::createKernel ($ options );
2828 }
2929
30- return self ::$ kernel ;
30+ return static ::$ kernel ;
3131 }
3232}
You can’t perform that action at this time.
0 commit comments