You are here

protected function ConnectionUnitTest::getConnectionID in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Database/ConnectionUnitTest.php \Drupal\system\Tests\Database\ConnectionUnitTest::getConnectionID()

Returns the connection ID of the current test connection.

Return value

integer

4 calls to ConnectionUnitTest::getConnectionID()
ConnectionUnitTest::testOpenClose in core/modules/system/src/Tests/Database/ConnectionUnitTest.php
Tests Database::closeConnection() without query.
ConnectionUnitTest::testOpenQueryClose in core/modules/system/src/Tests/Database/ConnectionUnitTest.php
Tests Database::closeConnection() with a query.
ConnectionUnitTest::testOpenQueryPrefetchClose in core/modules/system/src/Tests/Database/ConnectionUnitTest.php
Tests Database::closeConnection() with a query and custom prefetch method.
ConnectionUnitTest::testOpenSelectQueryClose in core/modules/system/src/Tests/Database/ConnectionUnitTest.php
Tests Database::closeConnection() with a select query.

File

core/modules/system/src/Tests/Database/ConnectionUnitTest.php, line 71
Contains \Drupal\system\Tests\Database\ConnectionUnitTest.

Class

ConnectionUnitTest
Tests management of database connections.

Namespace

Drupal\system\Tests\Database

Code

protected function getConnectionID() {
  return (int) Database::getConnection($this->target, $this->key)
    ->query('SELECT CONNECTION_ID()')
    ->fetchField();
}