function DriverSpecificConnectionUnitTestBase::testOpenClose
Tests Database::closeConnection() without query.
@todo getConnectionId() executes a query.
File
- 
              core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificConnectionUnitTestBase.php, line 100  
Class
- DriverSpecificConnectionUnitTestBase
 - Tests management of database connections.
 
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testOpenClose() : void {
  // Close the connection.
  Database::closeConnection(static::TEST_TARGET_CONNECTION);
  // Wait 20ms to give the database engine sufficient time to react.
  usleep(20000);
  // Verify that we are back to the original connection count.
  $this->assertNoConnection($this->id);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.