Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da333a0

Browse files
committed
[FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel
1 parent 4a5f22b commit da333a0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ protected static function getKernelClass()
138138
* Boots the Kernel for this test.
139139
*
140140
* @param array $options
141+
*
142+
* @return KernelInterface A KernelInterface instance
141143
*/
142144
protected static function bootKernel(array $options = array())
143145
{
144146
static::ensureKernelShutdown();
145147

146148
static::$kernel = static::createKernel($options);
147149
static::$kernel->boot();
150+
151+
return static::$kernel;
148152
}
149153

150154
/**

src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ abstract class WebTestCase extends KernelTestCase
3030
*/
3131
protected static function createClient(array $options = array(), array $server = array())
3232
{
33-
static::bootKernel($options);
33+
$kernel = static::bootKernel($options);
3434

35-
$client = static::$kernel->getContainer()->get('test.client');
35+
$client = $kernel->getContainer()->get('test.client');
3636
$client->setServerParameters($server);
3737

3838
return $client;

0 commit comments

Comments
 (0)