4 * This is a variant of CiviSeleniumSettings which autopopulates
5 * using data from $_ENV.
7 class CiviSeleniumSettings
{
8 public $publicSandbox = FALSE;
9 public $browser = '*firefox';
14 public $adminUsername;
15 public $adminPassword;
18 public $UFemail = 'noreply@civicrm.org';
21 public function __construct() {
23 foreach (array('CMS_URL', 'ADMIN_USER', 'ADMIN_PASS', 'DEMO_USER', 'DEMO_PASS') as $key) {
24 if (empty($GLOBALS['_CV'][$key])) {
28 if (!empty($required)) {
29 throw new RuntimeException("CiviSeleniumSettings failed to find required values from cv: "
30 . implode(' ', $required));
33 $path = parse_url($GLOBALS['_CV']['CMS_URL'], PHP_URL_PATH
);
34 $this->sandboxURL
= substr($GLOBALS['_CV']['CMS_URL'], 0, strlen($GLOBALS['_CV']['CMS_URL']) - strlen($path));
35 $this->sandboxPATH
= $path;
36 $this->fullSandboxPath
= $GLOBALS['_CV']['CMS_URL'];
37 $this->adminUsername
= $GLOBALS['_CV']['ADMIN_USER'];
38 $this->adminPassword
= $GLOBALS['_CV']['ADMIN_PASS'];
39 $this->username
= $GLOBALS['_CV']['DEMO_USER'];
40 $this->password
= $GLOBALS['_CV']['DEMO_PASS'];
41 $this->siteKey
= CIVICRM_SITE_KEY
;
42 $this->adminApiKey
= md5('apikeyadmin' . $GLOBALS['_CV']['CMS_DB_DSN'] . CIVICRM_SITE_KEY
);
43 $this->cookies
= array();
49 // function createConstCookie() {
52 // $civiConsts = array(
53 // 'CIVICRM_DSN' => CIVICRM_DSN,
54 // 'CIVICRM_UF_DSN' => CIVICRM_UF_DSN,
56 // 'sig' => md5(implode(';;', array(CIVICRM_DSN, CIVICRM_UF_DSN, $civibuild['SITE_TOKEN'], $now))),
60 // 'name' => 'civiConsts',
61 // 'value' => urlencode(json_encode($civiConsts)),