// Current logged-in user
protected $loggedInAs = NULL;
+ private $settingCache;
+
/**
* Constructor.
*
if (property_exists($this->settings, 'rcPort') && $this->settings->rcPort) {
$this->setPort($this->settings->rcPort);
}
+ $this->settingCache = array();
}
/**
return $_config_backend[$field];
}
+ /**
+ * @param string $field
+ * @return mixed
+ */
+ public function webtestGetSetting($field) {
+ if (!isset($this->settingCache[$field])) {
+ $result = $this->webtest_civicrm_api("Setting", "getsingle", array(
+ 'return' => $field,
+ ));
+ $this->settingCache[$field] = $result[$field];
+ }
+ return $this->settingCache[$field];
+ }
+
/**
* Ensures the required CiviCRM components are enabled.
* @param $components
// expected calc'd end date
$endDate = date('Y-m-d', mktime(0, 0, 0, 3, 31, $nextYear));
- $configVars = new CRM_Core_Config_Variables();
foreach (array(
'joinDate',
'startDate',
'endDate',
) as $date) {
- $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
+ $$date = CRM_Utils_Date::customFormat($$date, $this->webtestGetSetting('dateformatFull'));
}
$query = "
// expected calc'd end date
$endDate = date('Y-m-d', mktime(0, 0, 0, 8, 31, $currentYear + 2));
- $configVars = new CRM_Core_Config_Variables();
foreach (array(
'joinDate',
'startDate',
'endDate',
) as $date) {
- $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
+ $$date = CRM_Utils_Date::customFormat($$date, $this->webtestGetSetting('dateformatFull'));
}
$query = "
$joinDate = date('Y-m-d', mktime(0, 0, 0, 11, 15, $currentYear));
$startDate = date('Y-m-d', mktime(0, 0, 0, 1, 1, $currentYear));
$endDate = date('Y-m-d', mktime(0, 0, 0, 12, 31, $nextYear));
- $configVars = new CRM_Core_Config_Variables();
foreach (array(
'joinDate',
'startDate',
'endDate',
) as $date) {
- $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
+ $$date = CRM_Utils_Date::customFormat($$date, $this->webtestGetSetting('dateformatFull'));
}
$query = "
// expected calc'd start and end dates
$startDate = date('Y-m-d', mktime(0, 0, 0, 1, 1, $currentYear));
$endDate = date('Y-m-d', mktime(0, 0, 0, 12, 31, $currentYear));
- $configVars = new CRM_Core_Config_Variables();
foreach (array(
'joinDate',
'startDate',
'endDate',
) as $date) {
- $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
+ $$date = CRM_Utils_Date::customFormat($$date, $this->webtestGetSetting('dateformatFull'));
}
$query = "
}
public function testInheritedMembership() {
- $this->markTestSkipped('Skipping for now as it works fine locally.');
+ //$this->markTestSkipped('Skipping for now as it works fine locally.');
// Log in using webtestLogin() method
$this->webtestLogin();
$joinDate = date('Y-m-d');
$startDate = date('Y-m-d');
$endDate = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d') - 1, date('Y') + 1));
- $configVars = new CRM_Core_Config_Variables();
foreach (array(
'joinDate',
'startDate',
'endDate',
) as $date) {
- $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
+ $$date = CRM_Utils_Date::customFormat($$date, $this->webtestGetSetting('dateformatFull'));
}
$this->webtestVerifyTabularData(
$joinDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$startDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$endDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, $previousDay, $endYear));
- $configVars = new CRM_Core_Config_Variables();
foreach (array(
'joinDate',
'startDate',
'endDate',
) as $date) {
- $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
+ $$date = CRM_Utils_Date::customFormat($$date, $this->webtestGetSetting('dateformatFull'));
}
if (!$renew) {
$joinDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$startDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$endDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, $previousDay, $endYear));
- $configVars = new CRM_Core_Config_Variables();
foreach (array(
'joinDate',
'startDate',
'endDate',
) as $date) {
- $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
+ $$date = CRM_Utils_Date::customFormat($$date, $this->webtestGetSetting('dateformatFull'));
}
$this->click('css=li#tab_member a');
$joinDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$startDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$endDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, $previousDay, $endYear));
- $configVars = new CRM_Core_Config_Variables();
foreach (array(
'joinDate',
'startDate',
'endDate',
) as $date) {
- $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
+ $$date = CRM_Utils_Date::customFormat($$date, $this->webtestGetSetting('dateformatFull'));
}
$this->click("xpath=//div[@id='priceset']/div[2]/div[2]/div/span/input");
$joinDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$startDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$endDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, $previousDay, $endYear));
- $configVars = new CRM_Core_Config_Variables();
foreach (array(
'joinDate',
'startDate',
'endDate',
) as $date) {
- $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
+ $$date = CRM_Utils_Date::customFormat($$date, $this->webtestGetSetting('dateformatFull'));
}
$i = ($term == 3) ? 3 : (($term == 2) ? 2 : 1);
$this->waitForElementPresent("xpath=//div[@id='priceset']/div[2]/div[2]/div[$i]/span/input");