File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,24 @@ public function getClient()
74
74
*/
75
75
public function getContainer ()
76
76
{
77
- return self ::$ kernel ->getContainer ();
77
+ return $ this ->getKernel ()->getContainer ();
78
+ }
79
+
80
+ /**
81
+ * Ensures the kernel is available.
82
+ *
83
+ * @return \Symfony\Component\HttpKernel\KernelInterface
84
+ */
85
+ public function getKernel ()
86
+ {
87
+ if (null === self ::$ kernel ) {
88
+ self ::$ kernel = parent ::bootKernel ();
89
+ }
90
+ if (!self ::$ kernel ->getContainer ()) {
91
+ self ::$ kernel ->boot ();
92
+ }
93
+
94
+ return self ::$ kernel ;
78
95
}
79
96
80
97
/**
Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ public function testGetContainer()
61
61
$ this ->assertEquals ($ this ->container , $ this ->testCase ->getContainer ());
62
62
}
63
63
64
+ public function testGetKernel ()
65
+ {
66
+ $ this ->assertInstanceOf (KernelInterface::class, $ this ->testCase ->getKernel ());
67
+ }
68
+
64
69
public function provideTestDb ()
65
70
{
66
71
return [
You can’t perform that action at this time.
0 commit comments