[FrameworkBundle] Returns the kernel instance in KernelTestCase::bootKernel

This commit is contained in:
Grégoire Pineau 2017-04-04 15:38:28 +02:00
parent 4a5f22bc1e
commit da333a035d
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;