Skip to content
Snippets Groups Projects
Commit 84d1e518 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2867700 by erozqba, mondrake, mradcliffe, cilefen:...

Issue #2867700 by erozqba, mondrake, mradcliffe, cilefen: ConnectionUnitTest::testConnectionOpen fails if the driver is not implementing a PDO connection
parent 8bedf88b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -221,6 +221,12 @@ public function testConnectionOpen() {
$reflection = new \ReflectionObject($connection);
$connection_property = $reflection->getProperty('connection');
$connection_property->setAccessible(TRUE);
// Skip this test when a database driver does not implement PDO.
// An alternative database driver that does not implement PDO
// should implement its own connection test.
if (get_class($connection_property->getValue($connection)) !== 'PDO') {
$this->markTestSkipped('Ignored PDO connection unit test for this driver because it does not implement PDO.');
}
$error_mode = $connection_property->getValue($connection)
->getAttribute(\PDO::ATTR_ERRMODE);
$this->assertEqual($error_mode, \PDO::ERRMODE_EXCEPTION, 'Ensure the default error mode is set to exception.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment