Merge pull request #5077 from eileenmcnaughton/comment-full-stops
[civicrm-core.git] / tests / phpunit / WebTest / Import / MatchExternalIdTest.php
index 3b18b4bff1bf951bec742077154cec295ff00b68..91343b88c021011a02bb6db8645959f818a642e4 100644 (file)
@@ -22,7 +22,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
 
@@ -81,14 +81,14 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
    * @return array
    */
   public function _contributionIndividualCSVData() {
-    $firstName1  = substr(sha1(rand()), 0, 7);
-    $lastName1   = substr(sha1(rand()), 0, 7);
+    $firstName1 = substr(sha1(rand()), 0, 7);
+    $lastName1 = substr(sha1(rand()), 0, 7);
     $externalId1 = substr(sha1(rand()), 0, 4);
 
     $this->_addContact($firstName1, $lastName1, $externalId1);
 
-    $firstName2  = substr(sha1(rand()), 0, 7);
-    $lastName2   = substr(sha1(rand()), 0, 7);
+    $firstName2 = substr(sha1(rand()), 0, 7);
+    $lastName2 = substr(sha1(rand()), 0, 7);
     $externalId2 = substr(sha1(rand()), 0, 4);
 
     $this->_addContact($firstName2, $lastName2, $externalId2);
@@ -96,7 +96,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
     $headers = array(
       'external_identifier' => 'External Identifier',
       'fee_amount' => 'Fee Amount',
-                          'financial_type'         => 'Financial Type',
+      'financial_type' => 'Financial Type',
       'contribution_status_id' => 'Contribution Status',
       'total_amount' => 'Total Amount',
     );
@@ -105,21 +105,21 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
       array(
         'external_identifier' => $externalId1,
         'fee_amount' => '200',
-                             'financial_type'         => 'Donation',
+        'financial_type' => 'Donation',
         'contribution_status_id' => 'Completed',
         'total_amount' => '200',
       ),
       array(
         'external_identifier' => $externalId2,
         'fee_amount' => '400',
-                             'financial_type'         => 'Donation',
+        'financial_type' => 'Donation',
         'contribution_status_id' => 'Completed',
         'total_amount' => '400',
       ),
     );
     $fieldMapper = array(
       'mapper[0][0]' => 'external_identifier',
-                              'mapper[2][0]' => 'financial_type',
+      'mapper[2][0]' => 'financial_type',
       'mapper[4][0]' => 'total_amount',
     );
     return array($headers, $rows, $fieldMapper);
@@ -133,16 +133,16 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
   public function _memberIndividualCSVData() {
     $memTypeParams = $this->webtestAddMembershipType();
 
-    $firstName1  = substr(sha1(rand()), 0, 7);
-    $lastName1   = substr(sha1(rand()), 0, 7);
+    $firstName1 = substr(sha1(rand()), 0, 7);
+    $lastName1 = substr(sha1(rand()), 0, 7);
     $externalId1 = substr(sha1(rand()), 0, 4);
 
     $this->_addContact($firstName1, $lastName1, $externalId1);
     $startDate1 = date('Y-m-d');
     $year = date('Y') - 1;
 
-    $firstName2  = substr(sha1(rand()), 0, 7);
-    $lastName2   = substr(sha1(rand()), 0, 7);
+    $firstName2 = substr(sha1(rand()), 0, 7);
+    $lastName2 = substr(sha1(rand()), 0, 7);
     $externalId2 = substr(sha1(rand()), 0, 4);
 
     $this->_addContact($firstName2, $lastName2, $externalId2);
@@ -182,14 +182,14 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
   public function _participantIndividualCSVData() {
     $eventInfo = $this->_addNewEvent();
 
-    $firstName1  = substr(sha1(rand()), 0, 7);
-    $lastName1   = substr(sha1(rand()), 0, 7);
+    $firstName1 = substr(sha1(rand()), 0, 7);
+    $lastName1 = substr(sha1(rand()), 0, 7);
     $externalId1 = substr(sha1(rand()), 0, 4);
 
     $this->_addContact($firstName1, $lastName1, $externalId1);
 
-    $firstName2  = substr(sha1(rand()), 0, 7);
-    $lastName2   = substr(sha1(rand()), 0, 7);
+    $firstName2 = substr(sha1(rand()), 0, 7);
+    $lastName2 = substr(sha1(rand()), 0, 7);
     $externalId2 = substr(sha1(rand()), 0, 4);
 
     $this->_addContact($firstName2, $lastName2, $externalId2);
@@ -239,7 +239,8 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
    * @param string $lastName
    * @param int $externalId
    *
-   * @return int external id
+   * @return int
+   *   external id
    */
   public function _addContact($firstName, $lastName, $externalId) {
     $this->openCiviPage('contact/add', 'reset=1&ct=Individual');
@@ -266,7 +267,8 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
    *
    * @param array $params
    *
-   * @return array event details of newly created event
+   * @return array
+   *   event details of newly created event
    */
   public function _addNewEvent($params = array()) {
     if (empty($params)) {
@@ -318,7 +320,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
     $this->waitForElementPresent("_qf_Fee_upload-bottom");
     $this->click("CIVICRM_QFID_1_is_monetary");
     $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
-        $this->select( "financial_type_id", "value=4" );
+    $this->select("financial_type_id", "value=4");
 
     $counter = 1;
     foreach ($params['fee_level'] as $label => $amount) {
@@ -351,7 +353,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
     // verify event input on info page
     // start at Manage Events listing
     $this->openCiviPage('event/manage', 'reset=1');
-    $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$params['title']);
+    $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input", $params['title']);
     $this->click("_qf_SearchEvent_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->clickLink("link=" . $params['title'], NULL);
@@ -360,4 +362,5 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
 
     return $params;
   }
+
 }