INFRA-132 - Move stray comments into docblocks
[civicrm-core.git] / tests / phpunit / WebTest / Contribute / OfflineContributionTest.php
index 10c7e462402a969b0ec8369777b1ff50ddb4cebf..3f49498757790b260d19abcfe9a405881fb9085c 100644 (file)
@@ -2,7 +2,7 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -36,7 +36,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
     parent::setUp();
   }
 
-  function testStandaloneContributeAdd() {
+  public function testStandaloneContributeAdd() {
     $this->webtestLogin();
 
     // Create a contact to be used as soft creditor
@@ -46,7 +46,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
 
     //financial account for check
     $this->openCiviPage("admin/options/payment_instrument", "reset=1");
-    $financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/table/tbody//tr/td[1][text()='Check']/../td[3]");
+    $financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/table/tbody//tr/td[1]/div[text()='Check']/../../td[3]");
 
     // Add new Financial Account
     $orgName = 'Alberta ' . substr(sha1(rand()), 0, 7);
@@ -137,8 +137,6 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->type("invoice_id", time());
     $this->webtestFillDate('thankyou_date');
 
-
-
     //Premium section
     $this->click("Premium");
     $this->waitForElementPresent("fulfilled_date");
@@ -199,14 +197,14 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
       4 => 'Donation',
       2 => '50.00',
       6 => 'Completed',
-      1 => "{$firstName} {$lastName}"
+      1 => "{$firstName} {$lastName}",
     );
     foreach ($expected as $value => $label) {
       $this->verifyText("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[2]/td[$value]", preg_quote($label));
     }
   }
 
-  function testDeductibleAmount() {
+  public function testDeductibleAmount() {
     $this->webtestLogin();
 
     //add authorize .net payment processor
@@ -310,14 +308,14 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->_verifyAmounts($checkScenario5);
   }
 
-  //common function for doing offline contribution
   /**
+   * common function for doing offline contribution
    * @param array $params
-   * @param $firstName
-   * @param $lastName
+   * @param string $firstName
+   * @param string $lastName
    * @param $processorName
    */
-  function _doOfflineContribution($params, $firstName, $lastName, $processorName) {
+  public function _doOfflineContribution($params, $firstName, $lastName, $processorName) {
 
     $this->waitForElementPresent("css=li#tab_contribute a");
     $this->click("css=li#tab_contribute a");
@@ -366,11 +364,11 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->assertTrue($this->isTextPresent("The contribution record has been processed."), "Status message didn't show up after saving!");
   }
 
-  //common function for verifing total_amount, and non_deductible_amount
   /**
+   * common function for verifing total_amount, and non_deductible_amount
    * @param $verifyData
    */
-  function _verifyAmounts($verifyData) {
+  public function _verifyAmounts($verifyData) {
     // since we are doing test contributions we need to search for test contribution and select first contribution
     // record for the contact
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
@@ -382,7 +380,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
 
     foreach ($verifyData as $label => $value) {
-      if ( $label == 'sort_name' ) {
+      if ($label == 'sort_name') {
         continue;
       }
       $this->verifyText("xpath=//form[@id='ContributionView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
@@ -397,10 +395,10 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
       "xpath=//form[@id='Basic']/div[3]/div[1]/div[2]/table/tbody/tr[1]/td[11]/span/a[text()='View']");
 
     $this->clickLink("xpath=//form[@id='Basic']/div[3]/div[1]/div[2]/table/tbody/tr[1]/td[11]/span/a[text()='View']",
-    'crm-contact-actions-link', FALSE);
+      'crm-contact-actions-link', FALSE);
   }
 
-  function testOnlineContributionWithZeroAmount() {
+  public function testOnlineContributionWithZeroAmount() {
     $this->webtestLogin();
 
     // Create a contact to be used as soft creditor
@@ -431,7 +429,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
       'Financial Type' => 'Donation',
       'Total Amount' => '0.00',
       'Contribution Status' => 'Completed',
-      'Paid By' => 'Credit Card'
+      'Paid By' => 'Credit Card',
     );
     $this->webtestVerifyTabularData($expected);
   }