diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2025-01-12 23:12:38 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2025-01-29 12:42:44 +0100 |
commit | 7eb6f9b11d015ee9646478f0f6bc7d717eb1979c (patch) | |
tree | 67d06008e2477f176f36797874a0cbb2399c6419 /tests | |
parent | 4625ffa6b410f059f2629fabd85f6c8077babcbd (diff) | |
download | volse-hubzilla-7eb6f9b11d015ee9646478f0f6bc7d717eb1979c.tar.gz volse-hubzilla-7eb6f9b11d015ee9646478f0f6bc7d717eb1979c.tar.bz2 volse-hubzilla-7eb6f9b11d015ee9646478f0f6bc7d717eb1979c.zip |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/includes/dba/DbaPdoTest.php | 6 |
1 files changed, 5 insertions, 1 deletions
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}"); } |