title: Symfony PHPUnit self::$kernel is null in second test
body: <p>I am trying to create a PHPunit test accessing services from the container in symfony. To do so I call <code>self::bootKernel</code> in <code>setUpBeforeClass</code>. In the first test, the <code>self::$kernel</code> is ok, but the second test <code>self::$kernel</code> is null.</p>
  
  <p>This is a simple test to check it:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Tests;
  
  use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
  
  class KernelTest extends WebTestCase
  {
      public static function setUpBeforeClass(): void
      {
          self::bootKernel();
      }
  
      public function testMethod1(){
          $this-&gt;assertNotNull(self::$kernel);
      }
  
      public function testMethod2(){
          $this-&gt;assertNotNull(self::$kernel);
      }
  }
  </code></pre>
  
  <p>This produces the following output:</p>
  
  <pre><code>$ bin/phpunit tests/KernelTest.php 
  PHPUnit 7.5.18 by Sebastian Bergmann and contributors.
  
  Notice: Undefined index: warnings in /app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 334
  
  Warning: Invalid argument supplied for foreach() in /app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 334
  
  Testing App\Tests\KernelTest
  .F                                                                  2 / 2 (100%)
  
  Time: 58 ms, Memory: 16.00 MB
  
  There was 1 failure:
  
  1) App\Tests\KernelTest::testMethod2
  Failed asserting that null is not null.
  
  /app/tests/KernelTest.php:19
  
  FAILURES!
  Tests: 2, Assertions: 2, Failures: 1.
  </code></pre>
  
  <p>As you can see, the second test fails the assertion.</p>
  
  <p>This is the version that I am running of phpunit:</p>
  
  <pre><code>phpunit/phpunit                     8.5.2      The PHP Unit Testing framework.
  symfony/phpunit-bridge              v5.0.2     Symfony PHPUnit Bridge
  </code></pre>
  
  <p>What I am doing wrong? Should I boot kernel in each test? I would like to boot it only once.</p>