Issue #2280501 by alexpott: Fixed Ensure web tests are encapsulated.

8.0.x
Nathaniel Catchpole 2014-06-07 16:08:27 +01:00
parent 0a7f5b8443
commit 8d37d8f3ea
2 changed files with 11 additions and 0 deletions

View File

@ -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().
*/

View File

@ -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')));
}