protected function ConnectionUnitTest::getConnectionID

7.x database_test.test protected ConnectionUnitTest::getConnectionID()

Returns the connection ID of the current test connection.

Return value

integer

4 calls to ConnectionUnitTest::getConnectionID()
ConnectionUnitTest::testOpenClose in drupal-7.x/modules/simpletest/tests/database_test.test
Tests Database::closeConnection() without query.
ConnectionUnitTest::testOpenQueryClose in drupal-7.x/modules/simpletest/tests/database_test.test
Tests Database::closeConnection() with a query.
ConnectionUnitTest::testOpenQueryPrefetchClose in drupal-7.x/modules/simpletest/tests/database_test.test
Tests Database::closeConnection() with a query and custom prefetch method.
ConnectionUnitTest::testOpenSelectQueryClose in drupal-7.x/modules/simpletest/tests/database_test.test
Tests Database::closeConnection() with a select query.

File

drupal-7.x/modules/simpletest/tests/database_test.test, line 3961

Class

ConnectionUnitTest
Tests management of database connections.

Code

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