function StubConnection::__construct

Same name in other branches
  1. 10 core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php \Drupal\Tests\Core\Database\Stub\StubConnection::__construct()
  2. 11.x core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php \Drupal\Tests\Core\Database\Stub\StubConnection::__construct()

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.