Skip to content

Commit a146e4d

Browse files
committed
feature #22276 [FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel (lyrixx)
This PR was merged into the 3.3-dev branch. Discussion ---------- [FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- da333a0 [FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel
2 parents e47a50b + da333a0 commit a146e4d

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)