Navigation Menu

Skip to content

Commit

Permalink
minor #33950 [FrameworkBundle] Avoid using of kernel after shutdown i…
Browse files Browse the repository at this point in the history
…n 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
-------

49b58ed Avoid using of kernel after shutdown
  • Loading branch information
nicolas-grekas committed Nov 5, 2019
2 parents 9cebe4b + 49b58ed commit a2bccc6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
Expand Up @@ -35,6 +35,7 @@ abstract class KernelTestCase extends TestCase
private function doTearDown()
{
static::ensureKernelShutdown();
static::$kernel = null;
}

/**
Expand Down

0 comments on commit a2bccc6

Please sign in to comment.