protected function ConnectionUnitTest::assertConnection in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php \Drupal\KernelTests\Core\Database\ConnectionUnitTest::assertConnection()
- 10 core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php \Drupal\KernelTests\Core\Database\ConnectionUnitTest::assertConnection()
Asserts that a connection ID exists.
Parameters
int $id: The connection ID to verify.
4 calls to ConnectionUnitTest::assertConnection()
- ConnectionUnitTest::testOpenClose in core/
tests/ Drupal/ KernelTests/ Core/ Database/ ConnectionUnitTest.php - Tests Database::closeConnection() without query.
- ConnectionUnitTest::testOpenQueryClose in core/
tests/ Drupal/ KernelTests/ Core/ Database/ ConnectionUnitTest.php - Tests Database::closeConnection() with a query.
- ConnectionUnitTest::testOpenQueryPrefetchClose in core/
tests/ Drupal/ KernelTests/ Core/ Database/ ConnectionUnitTest.php - Tests Database::closeConnection() with a query and custom prefetch method.
- ConnectionUnitTest::testOpenSelectQueryClose in core/
tests/ Drupal/ KernelTests/ Core/ Database/ ConnectionUnitTest.php - Tests Database::closeConnection() with a select query.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ ConnectionUnitTest.php, line 79
Class
- ConnectionUnitTest
- Tests management of database connections.
Namespace
Drupal\KernelTests\Core\DatabaseCode
protected function assertConnection($id) {
$list = $this->monitor
->query('SHOW PROCESSLIST')
->fetchAllKeyed(0, 0);
return $this
->assertTrue(isset($list[$id]), new FormattableMarkup('Connection ID @id found.', [
'@id' => $id,
]));
}