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:
Fabien Potencier 2017-04-04 07:53:29 -07:00
commit a146e4da1b
2 changed files with 6 additions and 2 deletions

View File

@ -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;
}
/**

View File

@ -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;