You are here

protected function ConnectionUnitTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php \Drupal\KernelTests\Core\Database\ConnectionUnitTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php, line 38

Class

ConnectionUnitTest
Tests management of database connections.

Namespace

Drupal\KernelTests\Core\Database

Code

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

  // Create an additional connection to monitor the connections being opened
  // and closed in this test.
  $connection_info = Database::getConnectionInfo();
  Database::addConnectionInfo('default', 'monitor', $connection_info['default']);
  $this->monitor = Database::getConnection('monitor');
}