Issue #2280501 by alexpott: Fixed Ensure web tests are encapsulated.
parent
0a7f5b8443
commit
8d37d8f3ea
|
@ -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().
|
* Tests expected behavior of setUp().
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -74,7 +74,9 @@ services:
|
||||||
EOD;
|
EOD;
|
||||||
file_put_contents($this->siteDirectory . '/testing.services.yml', $yaml);
|
file_put_contents($this->siteDirectory . '/testing.services.yml', $yaml);
|
||||||
|
|
||||||
|
$original_container = \Drupal::getContainer();
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
$this->assertNotIdentical(\Drupal::getContainer(), $original_container, 'WebTestBase test creates a new container.');
|
||||||
// Create and log in an admin user.
|
// Create and log in an admin user.
|
||||||
$this->drupalLogin($this->drupalCreateUser(array('administer unit tests')));
|
$this->drupalLogin($this->drupalCreateUser(array('administer unit tests')));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue