minor #33950 [FrameworkBundle] Avoid using of kernel after shutdown in KernelTestCase (alexander-schranz)

This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Avoid using of kernel after shutdown in KernelTestCase

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #...
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

I had sadly something like this in my codebase:

```php
if (!static::$kernel) {
    static::bootKernel();
}
```

As the $kernel is never set again to null a old $kernel was still there. I would not only set the $container also the $kernel variable to null. ~~As this could be a BC Break I'm targeting master~~.

Commits
-------

49b58ed45e Avoid using of kernel after shutdown
This commit is contained in:
Nicolas Grekas 2019-11-05 15:21:40 +01:00
commit a2bccc6910
1 changed files with 1 additions and 0 deletions

View File

@ -35,6 +35,7 @@ abstract class KernelTestCase extends TestCase
private function doTearDown()
{
static::ensureKernelShutdown();
static::$kernel = null;
}
/**