protected function ConnectionUnitTest::assertConnection

7.x database_test.test protected ConnectionUnitTest::assertConnection($id)

Asserts that a connection ID exists.

Parameters

integer $id: The connection ID to verify.

4 calls to ConnectionUnitTest::assertConnection()
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 3971

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)));
}