You are here

public function StubConnection::__construct in Drupal 9

Constructs a Connection object.

Parameters

\PDO $connection: An object of the PDO class representing a database connection.

array $connection_options: An array of options for the connection.

string[]|null $identifier_quotes: The identifier quote characters. Defaults to an empty strings.

string|null $statement_class: A class to use as a statement class for deprecation testing.

Overrides Connection::__construct

File

core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php, line 46

Class

StubConnection
A stub of the abstract Connection class for testing purposes.

Namespace

Drupal\Tests\Core\Database\Stub

Code

public function __construct(\PDO $connection, array $connection_options, $identifier_quotes = [
  '',
  '',
], $statement_class = NULL) {
  $this->identifierQuotes = $identifier_quotes;
  if ($statement_class) {
    $this->statementClass = $statement_class;
    $this->statementWrapperClass = NULL;
  }
  parent::__construct($connection, $connection_options);
}