allow mariadb
authordemeritcowboy <demeritcowboy@hotmail.com>
Sat, 19 Nov 2022 22:50:51 +0000 (17:50 -0500)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Sat, 19 Nov 2022 22:50:51 +0000 (17:50 -0500)
tests/phpunit/CRM/Core/DAOTest.php

index 3164e416332a256e878fc42ceca23e1e1c178ba0..a3d9969699d407e1ab9cab2e1b6d6d74093536f7 100644 (file)
@@ -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);