From f35afca4834b2b12f62d2c5744ae9e812a7d238a Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Wed, 8 Sep 2021 15:20:10 +0100
Subject: [PATCH] Issue #3230714 by Beakerboy, mondrake: ConnectionUnitTest
 should be skipped for any database not psql or mysql

---
 .../Core/Database/ConnectionUnitTest.php      | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php b/core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php
index 58193c6db136..67a81adbfbea 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php
@@ -119,8 +119,9 @@ protected function assertNoConnection($id) {
    */
   public function testOpenClose() {
     // Do not run this test for an SQLite database.
-    if ($this->connection->databaseType() == 'sqlite') {
-      $this->markTestSkipped("This tests can not run with an SQLite database.");
+    $database_type = $this->connection->databaseType();
+    if ($database_type != 'mysql' && $database_type != 'pgsql') {
+      $this->markTestSkipped("This tests only runs on MySQL and PostgreSQL");
     }
 
     // Add and open a new connection.
@@ -145,8 +146,9 @@ public function testOpenClose() {
    */
   public function testOpenQueryClose() {
     // Do not run this test for an SQLite database.
-    if ($this->connection->databaseType() == 'sqlite') {
-      $this->markTestSkipped("This tests can not run with an SQLite database.");
+    $database_type = $this->connection->databaseType();
+    if ($database_type != 'mysql' && $database_type != 'pgsql') {
+      $this->markTestSkipped("This tests only runs on MySQL and PostgreSQL");
     }
 
     // Add and open a new connection.
@@ -174,8 +176,9 @@ public function testOpenQueryClose() {
    */
   public function testOpenQueryPrefetchClose() {
     // Do not run this test for an SQLite database.
-    if ($this->connection->databaseType() == 'sqlite') {
-      $this->markTestSkipped("This tests can not run with an SQLite database.");
+    $database_type = $this->connection->databaseType();
+    if ($database_type != 'mysql' && $database_type != 'pgsql') {
+      $this->markTestSkipped("This tests only runs on MySQL and PostgreSQL");
     }
 
     // Add and open a new connection.
@@ -203,8 +206,9 @@ public function testOpenQueryPrefetchClose() {
    */
   public function testOpenSelectQueryClose() {
     // Do not run this test for an SQLite database.
-    if ($this->connection->databaseType() == 'sqlite') {
-      $this->markTestSkipped("This tests can not run with an SQLite database.");
+    $database_type = $this->connection->databaseType();
+    if ($database_type != 'mysql' && $database_type != 'pgsql') {
+      $this->markTestSkipped("This tests only runs on MySQL and PostgreSQL");
     }
 
     // Add and open a new connection.
-- 
GitLab