Skip to content

Commit dafa4d2

Browse files
committed
[FrameworkBundle] made another small optimization for functional tests
1 parent 1454d61 commit dafa4d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
abstract class WebTestCase extends \PHPUnit_Framework_TestCase
2525
{
26+
static protected $class;
2627
static protected $kernel;
2728

2829
/**
@@ -142,9 +143,11 @@ static protected function getKernelClass()
142143
*/
143144
static protected function createKernel(array $options = array())
144145
{
145-
$class = static::getKernelClass();
146+
if (null === static::$class) {
147+
static::$class = static::getKernelClass();
148+
}
146149

147-
return new $class(
150+
return new static::$class(
148151
isset($options['environment']) ? $options['environment'] : 'test',
149152
isset($options['debug']) ? $options['debug'] : true
150153
);

0 commit comments

Comments
 (0)