[NFC] Fix Test failures on MySQL 8 caused by change in output of either create table...
authorSeamus Lee <seamuslee001@gmail.com>
Fri, 19 Mar 2021 22:17:14 +0000 (09:17 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 19 Mar 2021 22:17:14 +0000 (09:17 +1100)
tests/phpunit/CRM/Dedupe/MergerTest.php
tests/phpunit/CRM/Logging/LoggingTest.php

index afb758eaba9a8f0da1546984d44c1e111209bdf1..525c539d05cd84c69e9fea152252343c86ceeb85 100644 (file)
@@ -1429,8 +1429,8 @@ class CRM_Dedupe_MergerTest extends CiviUnitTestCase {
     $cidRefs = [];
     $sql = "
 SELECT
-    table_name,
-    column_name
+    table_name AS table_name,
+    column_name AS column_name
 FROM information_schema.key_column_usage
 WHERE
     referenced_table_schema = database() AND
index acce7ee0fac9f27c9f4f040b97006fa5849e2c17..562450aaa4d96dfcbe5539ea3428422f2bc6e638 100644 (file)
@@ -52,6 +52,8 @@ class CRM_Logging_LoggingTest extends CiviUnitTestCase {
     $this->assertTrue(
       in_array("  `logging_test` int(11) DEFAULT '0'", $create)
       || in_array("  `logging_test` int(11) DEFAULT 0", $create)
+      || in_array("  `logging_test` int DEFAULT '0'", $create)
+      || in_array("  `logging_test` int DEFAULT 0", $create)
     );
     CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_option_value` DROP COLUMN `logging_test`", [], FALSE, NULL, FALSE, FALSE);
     $query = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE `log_civicrm_option_value`", [], TRUE, NULL, FALSE, FALSE);
@@ -65,7 +67,10 @@ class CRM_Logging_LoggingTest extends CiviUnitTestCase {
     Civi::service('sql_triggers')->rebuild('civicrm_option_value');
     $this->assertTrue(
       in_array("  `logging_test` int(11) DEFAULT '0'", $create)
-      || in_array("  `logging_test` int(11) DEFAULT 0", $create));
+      || in_array("  `logging_test` int(11) DEFAULT 0", $create)
+      || in_array("  `logging_test` int DEFAULT '0'", $create)
+      || in_array("  `logging_test` int DEFAULT 0", $create)
+    );
     $logging->disableLogging();
   }