+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
$this->_testVerifyPriceSet($validateStrings, $sid);
}
- /**
- * @param $setTitle
- * @param $usedFor
- * @param $setHelp
- * @param null $financialType
- */
- public function _testAddSet($setTitle, $usedFor, $setHelp, $financialType = NULL) {
- $this->openCiviPage("admin/price", "reset=1&action=add", '_qf_Set_next-bottom');
-
- // Enter Priceset fields (Title, Used For ...)
- $this->type('title', $setTitle);
- if ($usedFor == 'Event') {
- $this->check('extends_1');
- }
- elseif ($usedFor == 'Contribution') {
- $this->check('extends_2');
- }
-
- if ($financialType) {
- $this->select("financial_type_id", "label={$financialType}");
- }
- $this->type('help_pre', $setHelp);
-
- $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
- $this->clickLink('_qf_Set_next-bottom');
- }
-
- /**
- * @param $fields
- * @param $validateString
- * @param $financialType
- * @param bool $dateSpecificFields
- */
- public function _testAddPriceFields(&$fields, &$validateString, $financialType, $dateSpecificFields = FALSE) {
- $validateStrings[] = $financialType;
- $sid = $this->urlArg('sid');
- $this->openCiviPage('admin/price/field', "reset=1&action=add&sid=$sid", 'label');
- foreach ($fields as $label => $type) {
- $validateStrings[] = $label;
-
- $this->type('label', $label);
- $this->select('html_type', "value={$type}");
-
- switch ($type) {
- case 'Text':
- $validateStrings[] = '525.00';
- $this->type('price', '525.00');
- if ($dateSpecificFields == TRUE) {
- $this->webtestFillDateTime('active_on', '+1 week');
- }
- else {
- $this->check('is_required');
- }
- break;
-
- case 'Select':
- $options = array(
- 1 => array(
- 'label' => 'Chicken',
- 'amount' => '30.00',
- ),
- 2 => array(
- 'label' => 'Vegetarian',
- 'amount' => '25.00',
- ),
- );
- $this->addMultipleChoiceOptions($options, $validateStrings);
- if ($dateSpecificFields == TRUE) {
- $this->webtestFillDateTime('expire_on', '-1 week');
- }
- break;
-
- case 'Radio':
- $options = array(
- 1 => array(
- 'label' => 'Yes',
- 'amount' => '50.00',
- ),
- 2 => array(
- 'label' => 'No',
- 'amount' => '0',
- ),
- );
- $this->addMultipleChoiceOptions($options, $validateStrings);
- $this->check('is_required');
- if ($dateSpecificFields == TRUE) {
- $this->webtestFillDateTime('active_on', '-1 week');
- }
- break;
-
- case 'CheckBox':
- $options = array(
- 1 => array(
- 'label' => 'First Night',
- 'amount' => '15.00',
- ),
- 2 => array(
- 'label' => 'Second Night',
- 'amount' => '15.00',
- ),
- );
- $this->addMultipleChoiceOptions($options, $validateStrings);
- if ($dateSpecificFields == TRUE) {
- $this->webtestFillDateTime('expire_on', '+1 week');
- }
- break;
-
- default:
- break;
- }
- $this->select('financial_type_id', "label={$financialType}");
- $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom', FALSE);
- $this->waitForText('crm-notification-container', "Price Field '$label' has been saved.");
- }
- }
-
/**
* @return string
*/