*/
protected $tempDirs;
- /**
- * @var CiviTestPdoUtils
- */
- public static $utils;
-
/**
* @var boolean populateOnce allows to skip db resets in setUp
*
self::$_dbName = self::getDBName();
- // create test database
- self::$utils = new CiviTestPdoUtils(CIVICRM_DSN);
-
// also load the class loader
require_once 'CRM/Core/ClassLoader.php';
CRM_Core_ClassLoader::singleton()->register();
self::$dbInit = TRUE;
}
- return $this->createDefaultDBConnection(self::$utils->pdo, $dbName);
+
+ return $this->createDefaultDBConnection(Civi\Test::pdo(), $dbName);
}
/**
}
self::$populateOnce = NULL;
- $builder = new CiviTestDB(self::$utils);
-
- static $isSchemaUpdated = FALSE;
- if (!$isSchemaUpdated) {
- $builder->updateSchema();
- $isSchemaUpdated = TRUE;
- }
-
- $builder->populate();
-
- // Rebuild triggers
- civicrm_api('system', 'flush', array('version' => 3, 'triggers' => 1));
-
- CRM_Core_BAO_ConfigSetting::setEnabledComponents(array(
- 'CiviEvent',
- 'CiviContribute',
- 'CiviMember',
- 'CiviMail',
- 'CiviReport',
- 'CiviPledge',
- ));
+ Civi\Test::data()->populate();
return TRUE;
}
$this->cleanTempDirs();
$this->unsetExtensionSystem();
- $this->clearOutputBuffer();
}
/**
}
}
- public function clearOutputBuffer() {
- while (ob_get_level() > 0) {
- ob_end_clean();
- }
- }
-
/**
* Assert the attachment exists.
*