[FrameworkBundle] made another small optimization for functional tests

This commit is contained in:
Fabien Potencier 2011-07-19 13:11:12 +02:00
parent 1454d61ad5
commit dafa4d28d6

View File

@ -23,6 +23,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
*/
abstract class WebTestCase extends \PHPUnit_Framework_TestCase
{
static protected $class;
static protected $kernel;
/**
@ -142,9 +143,11 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
*/
static protected function createKernel(array $options = array())
{
$class = static::getKernelClass();
if (null === static::$class) {
static::$class = static::getKernelClass();
}
return new $class(
return new static::$class(
isset($options['environment']) ? $options['environment'] : 'test',
isset($options['debug']) ? $options['debug'] : true
);