/**
* Test setDefaults for privacy radio buttons.
+ *
+ * @throws \Exception
*/
public function testDefaultValues() {
$sg = new CRM_Contact_Form_Search_Advanced();
$sg->controller = new CRM_Core_Controller();
- $sg->_formValues = [
+ $formValues = [
'group_search_selected' => 'group',
'privacy_options' => ['do_not_email'],
'privacy_operator' => 'OR',
'component_mode' => 1,
];
CRM_Core_DAO::executeQuery(
- "INSERT INTO civicrm_saved_search (form_values) VALUES('" . serialize($sg->_formValues) . "')"
+ "INSERT INTO civicrm_saved_search (form_values) VALUES('" . serialize($formValues) . "')"
);
$ssID = CRM_Core_DAO::singleValueQuery('SELECT LAST_INSERT_ID()');
$sg->set('ssID', $ssID);
+ $sg->set('formValues', $formValues);
$defaults = $sg->setDefaultValues();
- $this->checkArrayEquals($defaults, $sg->_formValues);
+ $this->checkArrayEquals($defaults, $formValues);
}
/**