'Pre-conference Meetup?' => 'Radio',
'Evening Sessions' => 'CheckBox',
);
- $this->_testAddPriceFields( $fields, $validateStrings, $financialType );
+ $this->_testAddPriceFields($fields, $validateStrings, $financialType);
// var_dump($validateStrings);
// load the Price Set Preview and check for expected values
$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 {
+ 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');
- }
- 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;
+ 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');
function _testAddFinancialType() {
//Add new Financial Type
- $financialType['name'] = 'FinancialType '.substr(sha1(rand()), 0, 4);
+ $financialType['name'] = 'FinancialType ' . substr(sha1(rand()), 0, 4);
$financialType['is_deductible'] = TRUE;
$financialType['is_reserved'] = FALSE;
$this->addeditFinancialType($financialType);
$this->webtestLogin();
//add financial type of account type expense
- $financialType= $this->_testAddFinancialType();
+ $financialType = $this->_testAddFinancialType();
$setTitle = 'Conference Fees - ' . substr(sha1(rand()), 0, 7);
$usedFor = 'Contribution';
$this->webtestLogin();
//create a contact and return the contact id
- $firstNameSoft = "John_".substr(sha1(rand()), 0, 5);
- $lastNameSoft = "Doe_".substr(sha1(rand()), 0, 5);
+ $firstNameSoft = "John_" . substr(sha1(rand()), 0, 5);
+ $lastNameSoft = "Doe_" . substr(sha1(rand()), 0, 5);
$this->webtestAddContact($firstNameSoft, $lastNameSoft);
$url = $this->parseURL();
$cid = $url['queryString']['cid'];
$this->type('trxn_id', 'P20901X1' . rand(100, 10000));
- $this->type('soft_credit_to', "$lastNameSoft, $firstNameSoft");
- $this->click('soft_credit_to');
- $this->waitForElementPresent("css=div.ac_results-inner li");
- $this->click("css=div.ac_results-inner li");
+ $this->webtestFillAutocomplete("{$lastNameSoft}, {$firstNameSoft}", 'soft_credit_contact_1');
+
//Additional Detail section
$this->click('AdditionalDetail');
$this->waitForElementPresent('thankyou_date');
// visit contact summary page
$this->click("css=div.ac_results-inner li");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->click( 'css=li#tab_contribute a' );
+ $this->click('css=li#tab_contribute a');
$this->waitForElementPresent('link=Record Contribution (Check, Cash, EFT ...)');
$id = explode('id=', $this->getAttribute("xpath=id('rowid')/td[7]/a[text()='View']@href"));
$this->webtestVerifyTabularData($expected);
- $params = array('contribution_id' => $id,
+ $params = array(
+ 'contribution_id' => $id,
'version' => 3,
);
// Retrieve contribution from the DB via api and verify DB values against view contribution page
require_once 'api/api.php';
- $fields = $this->webtest_civicrm_api('contribution','get',$params );
+ $fields = $this->webtest_civicrm_api('contribution', 'get', $params);
$params['id'] = $params['contact_id'] = $fields['values'][$fields['id']]['soft_credit_to'];
$softCreditContact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, TRUE);