Skip to content
Snippets Groups Projects
Unverified Commit a9eb36c5 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #19850 from seamuslee001/mysql8_logging_test_fix

[NFC] Fix logging schema test to work on MySQL8 as it no longer outpu…
parents a1012208 9ddc0612
Branches 4.7.9-rc
Tags 4.7.9
No related merge requests found
......@@ -415,8 +415,8 @@ class CRM_Logging_SchemaTest extends CiviUnitTestCase {
$dao = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE civicrm_test_table");
$dao->fetch();
// using regex since not sure it's always int(10), so accept int(10), int(11), integer, etc...
$this->assertRegExp('/`id` int(.+) unsigned NOT NULL AUTO_INCREMENT/', $dao->Create_Table);
$this->assertRegExp('/`activity_id` int(.+) unsigned NOT NULL/', $dao->Create_Table);
$this->assertRegExp('/`id` int(.*) unsigned NOT NULL AUTO_INCREMENT/', $dao->Create_Table);
$this->assertRegExp('/`activity_id` int(.*) unsigned NOT NULL/', $dao->Create_Table);
$this->assertStringContainsString('`texty` varchar(255)', $dao->Create_Table);
$this->assertStringContainsString('ENGINE=InnoDB', $dao->Create_Table);
$this->assertStringContainsString('FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE', $dao->Create_Table);
......@@ -426,8 +426,8 @@ class CRM_Logging_SchemaTest extends CiviUnitTestCase {
$dao->fetch();
$this->assertStringNotContainsString('AUTO_INCREMENT', $dao->Create_Table);
// This seems debatable whether `id` should lose its NOT NULL status
$this->assertRegExp('/`id` int(.+) unsigned DEFAULT NULL/', $dao->Create_Table);
$this->assertRegExp('/`activity_id` int(.+) unsigned DEFAULT NULL/', $dao->Create_Table);
$this->assertRegExp('/`id` int(.*) unsigned DEFAULT NULL/', $dao->Create_Table);
$this->assertRegExp('/`activity_id` int(.*) unsigned DEFAULT NULL/', $dao->Create_Table);
$this->assertStringContainsString('`texty` varchar(255)', $dao->Create_Table);
$this->assertStringContainsString('ENGINE=InnoDB', $dao->Create_Table);
$this->assertStringNotContainsString('FOREIGN KEY', $dao->Create_Table);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment