function DriverSpecificConnectionUnitTestBase::assertNoConnection
Asserts that a connection ID does not exist.
@internal
Parameters
int $id: The connection ID to verify.
4 calls to DriverSpecificConnectionUnitTestBase::assertNoConnection()
- DriverSpecificConnectionUnitTestBase::testOpenClose in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificConnectionUnitTestBase.php - Tests Database::closeConnection() without query.
- DriverSpecificConnectionUnitTestBase::testOpenQueryClose in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificConnectionUnitTestBase.php - Tests Database::closeConnection() with a query.
- DriverSpecificConnectionUnitTestBase::testOpenQueryPrefetchClose in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificConnectionUnitTestBase.php - Tests Database::closeConnection() with a query and custom prefetch method.
- DriverSpecificConnectionUnitTestBase::testOpenSelectQueryClose in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificConnectionUnitTestBase.php - Tests Database::closeConnection() with a select query.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificConnectionUnitTestBase.php, line 97
Class
- DriverSpecificConnectionUnitTestBase
- Tests management of database connections.
Namespace
Drupal\KernelTests\Core\DatabaseCode
protected function assertNoConnection(int $id) : void {
// Wait up to 100ms to give the database engine sufficient time to react.
$this->assertTrue($this->waitFor(0.1, function () use ($id) {
$key = $this->monitor
->query($this->getQuery()['processlist'])
->fetchAllKeyed(0, 0);
return !array_key_exists($id, $key);
}));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.