$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);
$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);