From fd050c48d465614144f4b3420e5a7b40e4700993 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Sat, 19 Nov 2022 17:50:51 -0500 Subject: [PATCH] allow mariadb --- tests/phpunit/CRM/Core/DAOTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/CRM/Core/DAOTest.php b/tests/phpunit/CRM/Core/DAOTest.php index 3164e41633..a3d9969699 100644 --- a/tests/phpunit/CRM/Core/DAOTest.php +++ b/tests/phpunit/CRM/Core/DAOTest.php @@ -499,6 +499,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { * Demonstrate it is modified showing the query now breaks. */ public function testModifyAndBreakQuery() { + $dbNameString = stripos(CRM_Utils_SQL::getDatabaseVersion(), 'mariadb') !== FALSE ? 'MariaDB' : 'MySQL'; /** * @param \Civi\Core\Event\QueryEvent $e */ @@ -511,7 +512,7 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { } catch (PEAR_Exception $e) { $this->assertEquals( - "SELECT * FROM civicrm_domain [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/* Forgot trailing comment markerSELECT * FROM civicrm_domain' at line 1]", + "SELECT * FROM civicrm_domain [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your $dbNameString server version for the right syntax to use near '/* Forgot trailing comment markerSELECT * FROM civicrm_domain' at line 1]", $e->getCause()->getUserInfo() ); Civi::dispatcher()->removeListener('civi.db.query', $listener); -- 2.25.1