Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-08-12-15-44-44
authorKurund Jalmi <kurund@yahoo.com>
Wed, 12 Aug 2015 10:50:08 +0000 (16:20 +0530)
committerKurund Jalmi <kurund@yahoo.com>
Wed, 12 Aug 2015 10:50:08 +0000 (16:20 +0530)
Conflicts:
CRM/Contribute/BAO/Contribution/Utils.php
templates/CRM/Contribute/Form/Contribution/Main.tpl
tests/phpunit/CiviTest/CiviSeleniumTestCase.php

15 files changed:
CRM/Activity/Form/Activity.php
CRM/Admin/Page/APIExplorer.php
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Core/BAO/CustomField.php
CRM/Core/BAO/CustomQuery.php
CRM/Export/BAO/Export.php
CRM/Mailing/Info.php
CRM/Price/BAO/PriceField.php
ang/crmMailing/services.js
api/v3/OptionValue.php
templates/CRM/Contribute/Form/Contribution/Confirm.tpl
templates/CRM/Contribute/Form/Contribution/Main.tpl
templates/CRM/Contribute/Form/Contribution/ThankYou.tpl
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php

index edb012a73177ff3b41ad03a7284ee40c587f69ce..aa1f9328d8d380b7b973af718d59385b1fbaf98f 100644 (file)
@@ -307,7 +307,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
 
     //Assigning Activity type name
     if ($this->_activityTypeId) {
-      $activityTName = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, 'AND v.value = ' . $this->_activityTypeId, 'name');
+      $activityTName = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, 'AND v.value = ' . $this->_activityTypeId, 'label');
       if ($activityTName[$this->_activityTypeId]) {
         $this->_activityTypeName = $activityTName[$this->_activityTypeId];
         $this->assign('activityTName', $activityTName[$this->_activityTypeId]);
index cef15f8ad896281f4afb40f3bc536e898132cc46..241f4e4c8ae4f8b542566b834bd96ab5fdfc1087 100644 (file)
@@ -105,8 +105,10 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page {
    * Ajax callback to display code docs
    */
   public static function getDoc() {
-    if (!empty($_GET['entity']) && strpos($_GET['entity'], '.') === FALSE) {
-      $entity = _civicrm_api_get_camel_name($_GET['entity']);
+    // Verify the API handler we're talking to is valid.
+    $entities = civicrm_api3('Entity', 'get');
+    $entity = CRM_Utils_Array::value('entity', $_GET);
+    if (!empty($entity) && in_array($entity, $entities['values']) && strpos($entity, '.') === FALSE) {
       $action = CRM_Utils_Array::value('action', $_GET);
       $doc = self::getDocblock($entity, $action);
       $result = array(
index ff5e327e8ee8bb4903dbe1f119a6820a7b895795..5ed203c184a3073be2c8c0202dc08fc6dc7070eb 100644 (file)
@@ -160,7 +160,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
         $paymentParams['contributionRecurID'] = $contribution->contribution_recur_id;
       }
 
-      if ($form->_contributeMode) {
+      if ($form->_contributeMode && $form->_amount > 0.0) {
         try {
           $payment = Civi\Payment\System::singleton()->getByProcessor($form->_paymentProcessor);
           if ($form->_contributeMode == 'notify') {
index a2c4f2cb6456b3d95d56913237373da16d382762..c6116e79a50ae131fe13d6f79cad7e99b0834a11 100644 (file)
@@ -1165,19 +1165,13 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
     switch ($html_type) {
       case 'Radio':
         if ($data_type == 'Boolean') {
-          // Do not assume that if not yes means no.
-          $display = '';
-          if ($value) {
-            $display = ts('Yes');
-          }
-          elseif ((string) $value === '0') {
-            $display = ts('No');
-          }
+          $option = array('No', 'Yes');
         }
-        elseif (is_array($value)) {
+        if (is_array($value)) {
           $display = NULL;
           foreach ($value as $data) {
             $display .= $display ? ', ' . $option[$data] : $option[$data];
+
           }
         }
         else {
index 34f2df43bd56845b4b31238e16ecd40c121b0304..648ec0f0f7abcc2c2eddc5582ab3045b3a41793e 100644 (file)
@@ -349,35 +349,6 @@ SELECT label, value
 
         $isSerialized = CRM_Core_BAO_CustomField::isSerialized($field);
 
-        // Handle multi-select search for any data type
-        if (is_array($value) && !$field['is_search_range'] && $field['data_type'] != 'String') {
-          $wildcard = $isSerialized ? $wildcard : TRUE;
-          $options = CRM_Utils_Array::value('values', civicrm_api3('contact', 'getoptions', array(
-                'field' => $name,
-                'context' => 'search',
-              ), array()));
-          $qillValue = '';
-          $sqlOP = $wildcard ? ' OR ' : ' AND ';
-          $sqlValue = array();
-          foreach ($value as $num => &$v) {
-            $sep = count($value) > (1 + $num) ? ', ' : (' ' . ($wildcard ? ts('OR') : ts('AND')) . ' ');
-            $qillValue .= ($num ? $sep : '') . $options[$v];
-            $v = CRM_Core_DAO::escapeString($v);
-            if ($isSerialized) {
-              $sqlValue[] = "( $fieldName like '%" . CRM_Core_DAO::VALUE_SEPARATOR . $v . CRM_Core_DAO::VALUE_SEPARATOR . "%' ) ";
-            }
-            else {
-              $v = "'$v'";
-            }
-          }
-          if (!$isSerialized) {
-            $sqlValue = array("$fieldName IN (" . implode(',', $value) . ")");
-          }
-          $this->_where[$grouping][] = ' ( ' . implode($sqlOP, $sqlValue) . ' ) ';
-          $this->_qill[$grouping][] = "$field[label] $qillOp $qillValue";
-          continue;
-        }
-
         // fix $value here to escape sql injection attacks
         $qillValue = NULL;
         if (!is_array($value)) {
@@ -389,15 +360,16 @@ SELECT label, value
           $qillValue = CRM_Core_BAO_CustomField::getDisplayValue($value[$op], $id, $this->_options);
         }
         else {
+          $op = 'IN';
           $qillValue = CRM_Core_BAO_CustomField::getDisplayValue($value, $id, $this->_options);
-          $value = array('IN' => $value);
         }
 
         $qillOp = CRM_Utils_Array::value($op, CRM_Core_SelectValues::getSearchBuilderOperators(), $op);
 
         switch ($field['data_type']) {
           case 'String':
-            $sql = "$fieldName";
+          case 'StateProvince':
+          case 'Country':
 
             if ($field['is_search_range'] && is_array($value)) {
               $this->searchRange($field['id'],
@@ -411,7 +383,12 @@ SELECT label, value
             else {
               // fix $value here to escape sql injection attacks
               if (!is_array($value)) {
-                $value = CRM_Utils_Type::escape($strtolower($value), 'String');
+                if ($field['data_type'] == 'String') {
+                  $value = CRM_Utils_Type::escape($strtolower($value), 'String');
+                }
+                else {
+                  $value = CRM_Utils_Type::escape($value, 'Integer');
+                }
               }
               elseif ($isSerialized) {
                 if (in_array(key($value), CRM_Core_DAO::acceptedSQLOperators(), TRUE)) {
@@ -436,7 +413,7 @@ SELECT label, value
               }
 
               //FIX for custom data query fired against no value(NULL/NOT NULL)
-              $this->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($sql, $op, $value, $field['data_type']);
+              $this->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fieldName, $op, $value, 'String');
               $this->_qill[$grouping][] = "$field[label] $qillOp $qillValue";
             }
             break;
@@ -453,59 +430,53 @@ SELECT label, value
             }
             else {
               $this->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fieldName, $op, $value, 'Integer');
-              $this->_qill[$grouping][] = $field['label'] . " $qillOp $value";
+              $this->_qill[$grouping][] = ts("%1 %2 %3", array(1 => $field['label'], 2 => $qillOp, 3 => $qillValue));;
             }
             break;
 
           case 'Boolean':
-            if (strtolower($value) == 'yes' || strtolower($value) == strtolower(ts('Yes'))) {
-              $value = 1;
-            }
-            else {
-              $value = (int) $value;
+            if (!is_array($value)) {
+              if (strtolower($value) == 'yes' || strtolower($value) == strtolower(ts('Yes'))) {
+                $value = 1;
+              }
+              else {
+                $value = (int) $value;
+              }
+              $value = ($value == 1) ? 1 : 0;
+              $qillValue = $value ? 'Yes' : 'No';
             }
-            $value = ($value == 1) ? 1 : 0;
             $this->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fieldName, $op, $value, 'Integer');
-            $value = $value ? ts('Yes') : ts('No');
-            $this->_qill[$grouping][] = $field['label'] . " $qillOp {$value}";
+            $this->_qill[$grouping][] = ts("%1 %2 %3", array(1 => $field['label'], 2 => $qillOp, 3 => $qillValue));
             break;
 
           case 'Link':
+          case 'Memo':
             $this->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fieldName, $op, $value, 'String');
-            $this->_qill[$grouping][] = $field['label'] . " $qillOp $value";
-            break;
-
-          case 'Float':
-            if ($field['is_search_range'] && is_array($value)) {
-              $this->searchRange($field['id'], $field['label'], $field['data_type'], $fieldName, $value, $grouping);
-            }
-            else {
-              $this->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fieldName, $op, $value, 'Float');
-              $this->_qill[$grouping][] = $field['label'] . " $qillOp {$value}";
-            }
+            $this->_qill[$grouping][] = ts("%1 %2 %3", array(1 => $field['label'], 2 => $qillOp, 3 => $qillValue));
             break;
 
           case 'Money':
-            if ($field['is_search_range'] && is_array($value)) {
+            if (is_array($value)) {
+              $value = CRM_Utils_Array::value($op, $value, $value);
               foreach ($value as $key => $val) {
                 $moneyFormat = CRM_Utils_Rule::cleanMoney($value[$key]);
                 $value[$key] = $moneyFormat;
               }
+            }
+            else {
+              $value = CRM_Utils_Rule::cleanMoney($value);
+            }
+
+          case 'Float':
+            if ($field['is_search_range']) {
               $this->searchRange($field['id'], $field['label'], $field['data_type'], $fieldName, $value, $grouping);
             }
             else {
-              $moneyFormat = CRM_Utils_Rule::cleanMoney($value);
-              $value = $moneyFormat;
               $this->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fieldName, $op, $value, 'Float');
-              $this->_qill[$grouping][] = $field['label'] . " {$qillOp} {$value}";
+              $this->_qill[$grouping][] = ts("%1 %2 %3", array(1 => $field['label'], 2 => $qillOp, 3 => $qillValue));
             }
             break;
 
-          case 'Memo':
-            $this->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fieldName, $op, $value, 'String');
-            $this->_qill[$grouping][] = "$field[label] $qillOp $value";
-            break;
-
           case 'Date':
             $fromValue = CRM_Utils_Array::value('from', $value);
             $toValue = CRM_Utils_Array::value('to', $value);
@@ -550,12 +521,6 @@ SELECT label, value
             }
             break;
 
-          case 'StateProvince':
-          case 'Country':
-            $this->_where[$grouping][] = "$fieldName {$op} " . CRM_Utils_Type::escape($value, 'Int');
-            $this->_qill[$grouping][] = $field['label'] . " {$qillOp} {$qillValue}";
-            break;
-
           case 'File':
             if ($op == 'IS NULL' || $op == 'IS NOT NULL' || $op == 'IS EMPTY' || $op == 'IS NOT EMPTY') {
               switch ($op) {
index c560444b4b537e2210255228f713ae48059b0fd3..f4c4ad4c3c3e94ae9ea0fc716415f659ff122c08 100644 (file)
@@ -1330,7 +1330,8 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
 
     // early exit for master_id, CRM-12100
     // in the DB it is an ID, but in the export, we retrive the display_name of the master record
-    if ($fieldName == 'master_id') {
+    // also for current_employer, CRM-16939
+    if ($fieldName == 'master_id' || $fieldName == 'current_employer') {
       $sqlColumns[$fieldName] = "$fieldName varchar(128)";
       return;
     }
index 2bed417cb922f85de163ef06fa749257311f1ec8..41bc8c8baa0466b97ab9191d02e37b903c488333 100644 (file)
@@ -131,11 +131,10 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
       'contact_id' => $contactID,
     ));
 
-    // FIXME: Loading the contents of every template into the dom does not scale well
     $mesTemplate = civicrm_api3('MessageTemplate', 'get', $params + array(
       'sequential' => 1,
       'is_active' => 1,
-      'return' => array("msg_html", "id", "msg_title", "msg_subject", "msg_text"),
+      'return' => array("id", "msg_title"),
       'workflow_id' => array('IS NULL' => ""),
     ));
     $mailTokens = civicrm_api3('Mailing', 'gettokens', array(
index 2ffa5de1e154968be08ffef6447571c60d9ccb0e..77525e93a95db91cf1ccc09603488a6d48eb2a68 100644 (file)
@@ -401,6 +401,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
             'price' => json_encode(array($elementName, $priceVal)),
             'data-amount' => $opt[$valueFieldName],
             'data-currency' => $currencyName,
+            'data-price-field-values' => json_encode($customOption),
           );
           if (!empty($qf->_quickConfig) && $field->name == 'contribution_amount') {
             $extra += array('onclick' => 'clearAmountOther();');
@@ -506,7 +507,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
             '' => ts('- select -'),
           ) + $selectOption,
           $useRequired && $field->is_required,
-          array('price' => json_encode($priceVal), 'class' => 'crm-select2')
+          array('price' => json_encode($priceVal), 'class' => 'crm-select2', 'data-price-field-values' => json_encode($customOption))
         );
 
         // CRM-6902 - Add "max" option for a price set field
index 6a155c93b05b21d270ff1a6aa313b1a2f82a5b7f..c76da9238f53be8cc50aac5d9539848c4e2cabce 100644 (file)
     window.tpls = tpls;
     var lastModifiedTpl = null;
     return {
+      // Get a template
+      // @param id MessageTemplate id  (per APIv3)
       // @return Promise MessageTemplate (per APIv3)
       get: function get(id) {
-        id = '' + id; // parseInt(id);
-        var dfr = $q.defer();
-        var tpl = _.where(tpls, {id: id});
-        if (id && tpl && tpl[0]) {
-          dfr.resolve(tpl[0]);
-        }
-        else {
-          dfr.reject(id);
-        }
-        return dfr.promise;
+        return crmApi('MessageTemplate', 'getsingle', {
+           "return": "id,msg_subject,msg_html,msg_title,msg_text",
+           "id": id
+        });
       },
       // Save a template
       // @param tpl MessageTemplate (per APIv3) For new templates, omit "id"
index 86b94c21c7bee016ecbf002d6cee206f4f4b2d19..c1f67e40281b80d801a39d828bb8a077211b5441 100644 (file)
@@ -91,7 +91,7 @@ function _civicrm_api3_option_value_create_spec(&$params) {
   $params['is_active']['api.default'] = 1;
   //continue to support component
   $params['component_id']['api.aliases'] = array('component');
-  $params['name']['api.aliases'] = array('label');
+  //  $params['name']['api.aliases'] = array('label');
   $params['option_group_id']['api.required'] = TRUE;
 }
 
index 3d16fc6f72048d24efeee1a4364b0cd217f0aac2..4f761d56e5c661f270c6490357aaa1d7db88be54 100644 (file)
@@ -54,7 +54,7 @@
 
     {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="confirmContribution"}
 
-    {if $amount GT 0 OR $minimum_fee GT 0 OR ( $priceSetID and $lineItem ) }
+    {if $amount GTE 0 OR $minimum_fee GTE 0 OR ( $priceSetID and $lineItem ) }
     <div class="crm-group amount_display-group">
        {if !$useForMember}
         <div class="header-dark">
index d56b63dd49f973af6bc8e28728f1c64378b484ce..967e30123adcc88c11cf9849d0638e2e7c57a5cf 100644 (file)
       payment_options.hide();
       payment_processor.hide();
       payment_information.hide();
-      // also unset selected payment methods
-      cj('input[name="payment_processor"]').removeProp('checked');
     }
     else {
       payment_options.show();
index 31f02f7c55c882885aa372714f9d82d44f708679..065a6dddd1d0b11de3c41629176b0a881219322e 100644 (file)
@@ -90,7 +90,7 @@
 
   {include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="thankContribution"}
 
-  {if $amount GT 0 OR $minimum_fee GT 0 OR ( $priceSetID and $lineItem ) }
+  {if $amount GTE 0 OR $minimum_fee GTE 0 OR ( $priceSetID and $lineItem ) }
     <div class="crm-group amount_display-group">
       {if !$useForMember}
         <div class="header-dark">
index faafb8f65aa28dfb0ca3ba764da8854fb0e4b440..20318ffdc3ced5c80ffb2d7e3a9d39c8e0e0b494 100644 (file)
@@ -852,7 +852,9 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     elseif ($processorType == 'AuthNet') {
       // FIXME: we 'll need to make a new separate account for testing
       $processorSettings = array(
-        'user_name' => '5ULu56ex',
+        //dummy live username/password are passed to bypass processor validation on live credential
+        'user_name' => '3HcY62mY',
+        'password' => '69943NrwaQA92b8J',
         'test_user_name' => '5ULu56ex',
         'password' => '7ARxW575w736eF5p',
         'test_password' => '7ARxW575w736eF5p',
@@ -877,6 +879,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     }
     elseif ($processorType == 'PayPal_Standard') {
       $processorSettings = array(
+        'user_name' => 'V18ki@9r5Bf.org',
         'test_user_name' => 'V18ki@9r5Bf.org',
       );
     }
index e51209ed78b4e511a28a19d35e74603cbc70e205..3bfe9eba135b85207e04da438a85d2fdb3b45fe4 100644 (file)
@@ -208,7 +208,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
    * @param $hash
    * @param bool $otherAmount
    */
-  public function _testOnlineMembershipSignup($pageId, $memTypeId, $firstName, $lastName, $payLater, $hash, $otherAmount = FALSE, $amountSection = TRUE) {
+  public function _testOnlineMembershipSignup($pageId, $memTypeId, $firstName, $lastName, $payLater, $hash, $otherAmount = FALSE, $amountSection = TRUE, $freeMembership = FALSE) {
     //Open Live Contribution Page
     $this->openCiviPage("contribute/transact", "reset=1&id=$pageId&action=preview", "_qf_Main_upload-bottom");
     // Select membership type 1
@@ -243,24 +243,30 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
     $this->type("postal_code-1", "94117");
     $this->select("country-1", "value=1228");
     $this->select("state_province-1", "value=1001");
-    if (!$payLater && $amountSection) {
-      //Credit Card Info
-      $this->select("credit_card_type", "value=Visa");
-      $this->type("credit_card_number", "4111111111111111");
-      $this->type("cvv2", "000");
-      $this->select("credit_card_exp_date[M]", "value=1");
-      $this->select("credit_card_exp_date[Y]", "value=2020");
-
-      //Billing Info
-      $this->waitForElementPresent("billing_first_name");
-      $this->type("billing_first_name", $firstName . "billing");
-      $this->waitForElementPresent("billing_last_name");
-      $this->type("billing_last_name", $lastName . "billing");
-      $this->type("billing_street_address-5", "15 Main St.");
-      $this->type(" billing_city-5", "San Jose");
-      $this->select("billing_country_id-5", "value=1228");
-      $this->select("billing_state_province_id-5", "value=1004");
-      $this->type("billing_postal_code-5", "94129");
+
+    if ($freeMembership) {
+      $this->waitForElementPresent("xpath=//div[@id='payment_information'][@style='display: none;']");
+    }
+    else {
+      if (!$payLater && $amountSection) {
+        //Credit Card Info
+        $this->select("credit_card_type", "value=Visa");
+        $this->type("credit_card_number", "4111111111111111");
+        $this->type("cvv2", "000");
+        $this->select("credit_card_exp_date[M]", "value=1");
+        $this->select("credit_card_exp_date[Y]", "value=2020");
+
+        //Billing Info
+        $this->waitForElementPresent("billing_first_name");
+        $this->type("billing_first_name", $firstName . "billing");
+        $this->waitForElementPresent("billing_last_name");
+        $this->type("billing_last_name", $lastName . "billing");
+        $this->type("billing_street_address-5", "15 Main St.");
+        $this->type(" billing_city-5", "San Jose");
+        $this->select("billing_country_id-5", "value=1228");
+        $this->select("billing_state_province_id-5", "value=1004");
+        $this->type("billing_postal_code-5", "94129");
+      }
     }
     $this->click("_qf_Main_upload-bottom");
     $this->waitForElementPresent("_qf_Confirm_next-bottom");
@@ -411,59 +417,74 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
     $this->clickLink('_qf_MembershipBlock_next', '_qf_MembershipBlock_next-bottom');
     $text = "'MembershipBlock' information has been saved.";
     $this->waitForText('crm-notification-container', $text);
-    $this->click('link=Amounts');
-    $this->waitForElementPresent('_qf_Amount_cancel-bottom');
-    $this->click('is_monetary');
-    $this->clickLink('_qf_Amount_upload_done-bottom');
-    $text = "'Amount' information has been saved.";
-    $this->waitForText('crm-notification-container', $text);
-
-    $firstName = 'Ma' . substr(sha1(rand()), 0, 4);
-    $lastName = 'An' . substr(sha1(rand()), 0, 7);
-
-    //logout
-    $this->webtestLogout();
-
-    $this->_testOnlineMembershipSignup($pageId, $memTypeTitle, $firstName, $lastName, $payLater, $hash, $allowOtherAmount, $amountSection);
 
-    // Log in using webtestLogin() method
-    $this->webtestLogin();
-
-    //Find Contribution
-    $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
-    $this->type("sort_name", "$lastName $firstName");
-    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
-
-    //View Contribution Record and verify data
-    $expected = array(
-      'From' => "{$firstName} {$lastName}",
-      'Financial Type' => 'Member Dues',
-      'Total Amount' => '0.00',
-      'Contribution Status' => 'Completed',
-      'Received Into' => 'Deposit Bank Account',
-      'Source' => "Online Contribution: $contributionTitle",
-      'Online Contribution Page' => $contributionTitle,
+    $processors = array(
+      'Test Processor',
+      'AuthNet',
+      'PayPal',
+      'PayPal_Standard',
     );
-    $this->webtestVerifyTabularData($expected);
+    foreach ($processors as $processor) {
+      if ($processor == 'Test Processor') {
+        $processorName = $processor;
+      }
+      else {
+        $processorName = $processor . substr(sha1(rand()), 0, 7);
+        $this->webtestAddPaymentProcessor($processorName, $processor);
+      }
+      $this->openCiviPage("admin/contribute/amount", "reset=1&action=update&id={$pageId}", '_qf_Amount_upload_done-bottom');
+      $this->assertTrue($this->isTextPresent($processorName));
+      $this->check("xpath=//label[text() = '{$processorName}']/preceding-sibling::input[1]");
+      $this->clickLink('_qf_Amount_upload_done-bottom');
+      $this->waitForText('crm-notification-container', "'Amount' information has been saved.");
+
+      $firstName = 'Ma' . substr(sha1(rand()), 0, 4);
+      $lastName = 'An' . substr(sha1(rand()), 0, 7);
+
+      //logout
+      $this->webtestLogout();
+
+      $this->_testOnlineMembershipSignup($pageId, $memTypeTitle, $firstName, $lastName, $payLater, $hash, $allowOtherAmount, $amountSection, TRUE);
+
+      // Log in using webtestLogin() method
+      $this->webtestLogin();
+
+      //Find Contribution
+      $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
+      $this->type("sort_name", "$lastName $firstName");
+      $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+      $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
+
+      //View Contribution Record and verify data
+      $expected = array(
+        'From' => "{$firstName} {$lastName}",
+        'Financial Type' => 'Member Dues',
+        'Total Amount' => '0.00',
+        'Contribution Status' => 'Completed',
+        'Received Into' => 'Payment Processor Account',
+        'Source' => "Online Contribution: $contributionTitle",
+        'Online Contribution Page' => $contributionTitle,
+      );
+      $this->webtestVerifyTabularData($expected);
 
-    //Find Member
-    $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
+      //Find Member
+      $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
-    $this->type("sort_name", "$lastName $firstName");
-    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']/table/tbody/tr");
-    $this->click("xpath=//div[@id='memberSearch']/table/tbody/tr/td[11]/span/a[text()='View']");
-    $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
+      $this->type("sort_name", "$lastName $firstName");
+      $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']/table/tbody/tr");
+      $this->click("xpath=//div[@id='memberSearch']/table/tbody/tr/td[11]/span/a[text()='View']");
+      $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
-    //View Membership Record
-    $verifyData = array(
-      'Member' => $firstName . ' ' . $lastName,
-      'Membership Type' => $memTypeTitle,
-      'Source' => 'Online Contribution:' . ' ' . $contributionTitle,
-      'Status' => 'New',
-    );
+      //View Membership Record
+      $verifyData = array(
+        'Member' => $firstName . ' ' . $lastName,
+        'Membership Type' => $memTypeTitle,
+        'Source' => 'Online Contribution:' . ' ' . $contributionTitle,
+        'Status' => 'New',
+      );
 
-    $this->webtestVerifyTabularData($verifyData);
+      $this->webtestVerifyTabularData($verifyData);
+    }
   }
 
 }