Closed
Description
Symfony version(s) affected
4.4.39
Description
I just updated an ancient Symfony 4.4 app and noticed that in release 4.4.39 out unit tests break due to symfony/framework-bundle@cd52737
After debugging I noticed that this happens because bootKernel
assigns the new kernel to self::$kernel
, but a few lines down, the container is read from static::$kernel
, which in my case is a different class (i.e. my test class extending KernelTestcase
):
How to reproduce
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class MyTest extends WebTestCase
{
protected static $kernel;
public function testUserlist()
{
static::createClient();
}
}
Possible Solution
change all occurences to either self
or static
Additional Context
No response