function SharedDatabaseStateViolationTest::setUpEnvironment
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/SharedDatabaseStateViolationTest.php \Drupal\KernelTests\SharedDatabaseStateViolationTest::setUpEnvironment()
Sets up the environment shared by every test method in this class.
Runs once per test class instead of once per test method, and only when the shared environment has to be built. Does nothing by default.
Must be deterministic: what this creates is reused by every test method.
Overrides KernelTestBase::setUpEnvironment
File
-
core/
tests/ Drupal/ KernelTests/ SharedDatabaseStateViolationTest.php, line 57
Class
- SharedDatabaseStateViolationTest
- Tests how "KernelTestBase" reports shared database state violations.
Namespace
Drupal\KernelTestsCode
protected function setUpEnvironment() : void {
$this->installEntitySchema('user');
$this->installConfig([
'system',
]);
$connection = $this->container
->get('database');
$connection->schema()
->createTable(self::PROBE_TABLE, self::PROBE_SCHEMA);
$connection->insert(self::PROBE_TABLE)
->fields([
'id' => 1,
])
->execute();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.