function DatabaseTestBase::setUp

Same name in this branch
  1. 10 core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php \Drupal\KernelTests\Core\Database\DatabaseTestBase::setUp()
Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php \Drupal\Tests\system\Functional\Database\DatabaseTestBase::setUp()
  2. 9 core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php \Drupal\KernelTests\Core\Database\DatabaseTestBase::setUp()
  3. 8.9.x core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php \Drupal\Tests\system\Functional\Database\DatabaseTestBase::setUp()
  4. 8.9.x core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php \Drupal\KernelTests\Core\Database\DatabaseTestBase::setUp()
  5. 11.x core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php \Drupal\Tests\system\Functional\Database\DatabaseTestBase::setUp()
  6. 11.x core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php \Drupal\KernelTests\Core\Database\DatabaseTestBase::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php, line 32

Class

DatabaseTestBase
Base class for databases database tests.

Namespace

Drupal\Tests\system\Functional\Database

Code

protected function setUp() : void {
    parent::setUp();
    $this->connection = Database::getConnection();
    $this->addSampleData();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.