You are here

protected static function UpdatePathTestInstallHelper::getConnection in Style Switcher 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/Update/UpdatePathTestInstallHelper.php \Drupal\Tests\styleswitcher\Functional\Update\UpdatePathTestInstallHelper::getConnection()

Gets the DB connection object.

Return value

\Drupal\Core\Database\Connection The DB connection object.

File

tests/src/Functional/Update/UpdatePathTestInstallHelper.php, line 27

Class

UpdatePathTestInstallHelper
Helps install database additions for a testing of update paths.

Namespace

Drupal\Tests\styleswitcher\Functional\Update

Code

protected static function getConnection() : Connection {
  if (!isset(static::$connection)) {
    static::$connection = Database::getConnection();
  }
  return static::$connection;
}