$params = array('version' => $this->_apiversion,
'domain_id' => 'all',
'uniq_email_per_site' => 1,
- 'debug' =>1,
);
$result = civicrm_api('setting', 'create', $params);
$description = "shows setting a variable for all domains";
$settings = civicrm_api('setting', 'get', array(
'name' => 'defaultCurrency',
'version' => $this->_apiversion,
- 'sequential' => 1,
- 'debug' => 1)
+ 'sequential' => 1,)
);
$this->assertAPISuccess($settings);
$this->assertEquals('USD', $settings['values'][0]['defaultCurrency']);
}
+
+ /**
+ * setting api should set & fetch settings stored in config as well as those in settings table
+ */
+ function testGetSetConfigSettingMultipleDomains() {
+ $settings = civicrm_api('setting', 'create', array(
+ 'defaultCurrency' => 'USD',
+ 'version' => $this->_apiversion,
+ 'domain_id' => $this->_currentDomain)
+ );
+ $settings = civicrm_api('setting', 'create', array(
+ 'defaultCurrency' => 'CAD',
+ 'version' => $this->_apiversion,
+ 'domain_id' => $this->_domainID2)
+ );
+ $this->assertAPISuccess($settings);
+ $settings = civicrm_api('setting', 'get', array(
+ 'return' => 'defaultCurrency',
+ 'version' => $this->_apiversion,
+ 'domain_id' => 'all',
+ )
+ );
+ $this->assertEquals('USD', $settings['values'][$this->_currentDomain]['defaultCurrency']);
+ $this->assertEquals('CAD', $settings['values'][$this->_domainID2]['defaultCurrency'],
+ "second domain (id {$this->_domainID2} ) should be set to CAD. First dom was {$this->_currentDomain} & was USD");
+
+ }
+
/*
* Use getValue against a config setting
*/