Error message
You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).function ConnectionUnitTest::assertConnection
Asserts that a connection ID exists.
Parameters
integer $id: The connection ID to verify.
4 calls to ConnectionUnitTest::assertConnection()
- ConnectionUnitTest::testOpenClose in modules/
simpletest/ tests/ database_test.test - Tests Database::closeConnection() without query.
- ConnectionUnitTest::testOpenQueryClose in modules/
simpletest/ tests/ database_test.test - Tests Database::closeConnection() with a query.
- ConnectionUnitTest::testOpenQueryPrefetchClose in modules/
simpletest/ tests/ database_test.test - Tests Database::closeConnection() with a query and custom prefetch method.
- ConnectionUnitTest::testOpenSelectQueryClose in modules/
simpletest/ tests/ database_test.test - Tests Database::closeConnection() with a select query.
File
-
modules/
simpletest/ tests/ database_test.test, line 4356
Class
- ConnectionUnitTest
- Tests management of database connections.
Code
protected function assertConnection($id) {
$list = $this->monitor
->query ('SHOW PROCESSLIST')
->fetchAllKeyed (0, 0);
return $this->assertTrue (isset($list[$id]), format_string ('Connection ID @id found.', array(
'@id' => $id,
)));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.