From 7eb6f9b11d015ee9646478f0f6bc7d717eb1979c Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 12 Jan 2025 23:12:38 +0100 Subject: Only skip DbaPdo returning test on actual MySQL MySQL does not support the INSERT...RETURNING clause, while MariaDB does. This patch ensures that the test is not skipped on MariaDB, but only on an actual MySQL system. --- tests/unit/includes/dba/DbaPdoTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit/includes/dba/DbaPdoTest.php b/tests/unit/includes/dba/DbaPdoTest.php index 39fdbe3e5..7eb66b791 100644 --- a/tests/unit/includes/dba/DbaPdoTest.php +++ b/tests/unit/includes/dba/DbaPdoTest.php @@ -21,7 +21,11 @@ class DbaPdoTest extends UnitTestCase public function testInsertingRowWithRturningClauseReturnsInsertedRow(): void { $driver = DBA::$dba->db->getAttribute(PDO::ATTR_DRIVER_NAME); - if ($driver === 'mysql') { + $version = DBA::$dba->db->getAttribute(PDO::ATTR_SERVER_VERSION); + + // MySQL does not support the `returning` clause, so we skip the test + // for that DB backend. + if ($driver === 'mysql' && stripos($version, 'mariadb') === false) { $this->markTestSkipped("RETURNING clause not supported for {$driver}"); } -- cgit v1.2.3