예제 #1
0
 /**
  * Check we can update legacy log tables using the api function.
  */
 public function testUpdateLogTableHookINNODB()
 {
     $this->createLegacyStyleContactLogTable();
     $this->callAPISuccess('Setting', 'create', array('logging' => TRUE));
     $this->hookClass->setHook('civicrm_alterLogTables', array($this, 'innodbLogTableSpec'));
     $this->callAPISuccess('System', 'updatelogtables', array());
     $this->checkINNODBLogTableCreated();
     $this->checkTriggersCreated(TRUE);
     // Make sure that the absence of a hook specifying INNODB does not cause revert to archive.
     // Only a positive action, like specifying ARCHIVE in a hook should trigger a change back to archive.
     $this->hookClass->setHook('civicrm_alterLogTables', array());
     $schema = new CRM_Logging_Schema();
     $spec = $schema->getLogTableSpec();
     $this->assertEquals(array(), $spec['civicrm_contact']);
     $this->callAPISuccess('System', 'updatelogtables', array());
     $this->checkINNODBLogTableCreated();
 }