/** * @param bool $perClass * @param null $object * @return bool * TRUE if the populate logic runs; FALSE if it is skipped */ protected static function _populateDB($perClass = FALSE, &$object = NULL) { if (CIVICRM_UF !== 'UnitTests') { throw new \RuntimeException("_populateDB requires CIVICRM_UF=UnitTests"); } if ($perClass || $object == NULL) { $dbreset = TRUE; } else { $dbreset = $object->requireDBReset(); } if (self::$populateOnce || !$dbreset) { return FALSE; } self::$populateOnce = NULL; Civi\Test::data()->populate(); return TRUE; }
public function cleanDB() { self::$populateOnce = NULL; $this->DBResetRequired = TRUE; $this->_dbconn = $this->getConnection(); static::_populateDB(); $this->tempDirs = array(); }