// install test database
echo PHP_EOL . "Installing {$dbName} database" . PHP_EOL;
- self::_populateDB(FALSE, $this);
+ static::_populateDB(FALSE, $this);
self::$dbInit = TRUE;
}
protected function getDataSet() {
}
- private static function _populateDB($perClass = FALSE, &$object = NULL) {
+ /**
+ * @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 ($perClass || $object == NULL) {
$dbreset = TRUE;
}
if (self::$populateOnce || !$dbreset) {
- return;
+ return FALSE;
}
self::$populateOnce = NULL;
// Rebuild triggers
civicrm_api('system', 'flush', array('version' => 3, 'triggers' => 1));
+
+ return TRUE;
}
public static function setUpBeforeClass() {
- self::_populateDB(TRUE);
+ static::_populateDB(TRUE);
// also set this global hack
$GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array();
$this->DBResetRequired = TRUE;
$this->_dbconn = $this->getConnection();
- $this->_populateDB();
+ static::_populateDB();
$this->tempDirs = array();
}