diff --git a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php index 1537393876c..34d78f19ea2 100644 --- a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php +++ b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php @@ -29,6 +29,15 @@ class KernelTestBaseTest extends KernelTestBase { ); } + /** + * {@inheritdoc} + */ + protected function setUp() { + $original_container = \Drupal::getContainer(); + parent::setUp(); + $this->assertNotIdentical(\Drupal::getContainer(), $original_container, 'KernelTestBase test creates a new container.'); + } + /** * Tests expected behavior of setUp(). */ diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php index a0e57381d16..b2fffb36d60 100755 --- a/core/modules/simpletest/src/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php @@ -74,7 +74,9 @@ services: EOD; file_put_contents($this->siteDirectory . '/testing.services.yml', $yaml); + $original_container = \Drupal::getContainer(); parent::setUp(); + $this->assertNotIdentical(\Drupal::getContainer(), $original_container, 'WebTestBase test creates a new container.'); // Create and log in an admin user. $this->drupalLogin($this->drupalCreateUser(array('administer unit tests'))); }