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
-------
da333a035d
[FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel
This commit is contained in:
commit
a146e4da1b
@ -138,6 +138,8 @@ abstract class KernelTestCase extends TestCase
|
||||
* Boots the Kernel for this test.
|
||||
*
|
||||
* @param array $options
|
||||
*
|
||||
* @return KernelInterface A KernelInterface instance
|
||||
*/
|
||||
protected static function bootKernel(array $options = array())
|
||||
{
|
||||
@ -145,6 +147,8 @@ abstract class KernelTestCase extends TestCase
|
||||
|
||||
static::$kernel = static::createKernel($options);
|
||||
static::$kernel->boot();
|
||||
|
||||
return static::$kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -30,9 +30,9 @@ abstract class WebTestCase extends KernelTestCase
|
||||
*/
|
||||
protected static function createClient(array $options = array(), array $server = array())
|
||||
{
|
||||
static::bootKernel($options);
|
||||
$kernel = static::bootKernel($options);
|
||||
|
||||
$client = static::$kernel->getContainer()->get('test.client');
|
||||
$client = $kernel->getContainer()->get('test.client');
|
||||
$client->setServerParameters($server);
|
||||
|
||||
return $client;
|
||||
|
Reference in New Issue
Block a user