function StubPDO::__construct

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

Construction method.

We override this construction method with a no-op in order to mock \PDO under unit tests.

See also

http://stackoverflow.com/questions/3138946/mocking-the-pdo-object-using…

File

core/tests/Drupal/Tests/Core/Database/Stub/StubPDO.php, line 29

Class

StubPDO
A stub of \PDO for testing purposes.

Namespace

Drupal\Tests\Core\Database\Stub

Code

public function __construct() {
    // No-op.
}

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