add missing comments - tests directory
[civicrm-core.git] / tests / phpunit / WebTest / Contribute / UpdateContributionTest.php
index a7609daf0006b910eff3d2b2d9933c8666bf7672..b9c9451b7a676aa79e29ff00d7959a54c8b7b0d7 100644 (file)
@@ -46,7 +46,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    $this->type("sort_name", "$lastName, $firstName");
    $this->click("_qf_Search_refresh");
 
-   $this->waitForElementPresent("xpath=//div[@class='crm-content-block']//div[@id='contributionSearch']");
+   $this->waitForElementPresent("xpath=//*[@id='Search']//div[@id='contributionSearch']");
    $contriIDOff = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1]@href"));
    if (!empty($contriIDOff)) {
      $contriIDOff = substr($contriIDOff[1], (strrpos($contriIDOff[1], '=') + 1));
@@ -54,7 +54,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
 
    $this->clickLink("xpath=//tr[@id='rowid{$contriIDOff}']/td[11]/span/a[2]", "total_amount", FALSE);
    $this->type("total_amount", "90");
-   $this->clickLink('_qf_Contribution_upload');
+   $this->clickLink('_qf_Contribution_upload','',FALSE);
 
    // Is status message correct?
    $this->waitForText('crm-notification-container', "The contribution record has been saved.");
@@ -132,7 +132,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    $this->select("account_relationship", "label=Premiums Inventory Account is");
    $this->select("financial_account_id", "label=$to");
    $this->clickLink("_qf_FinancialTypeAccount_next-botttom", "xpath=//a[@id='newfinancialTypeAccount']", FALSE);
-   
+
    $premiumName = 'Premium'.substr(sha1(rand()), 0, 7);
    $amount = 500;
    $sku = 'SKU';
@@ -204,7 +204,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
    $this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']");
    $this->clickLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom", FALSE);
-   
+
    $this->select("account_relationship", "label=Premiums Inventory Account is");
    $this->select("financial_account_id", "label=$to");
    $this->clickLink("_qf_FinancialTypeAccount_next-botttom", "xpath=//a[@id='newfinancialTypeAccount']", FALSE);
@@ -384,7 +384,16 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    $this->assertEquals($fValue2, "100.00", "Verify Amount");
  }
 
- function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") {
+  /**
+   * @param $entityId
+   * @param null $from
+   * @param null $to
+   * @param null $cost
+   * @param null $entityTable
+   * @param string $select
+   *
+   * @return null|string
+   */function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") {
    $financialAccount = CRM_Contribute_PseudoConstant::financialAccount();
    $query = "SELECT
      {$select}
@@ -408,7 +417,11 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    return $result;
  }
 
- function _getFinancialTrxnAmount($contId) {
+  /**
+   * @param $contId
+   *
+   * @return null|string
+   */function _getFinancialTrxnAmount($contId) {
    $query = "SELECT
      SUM( ft.total_amount ) AS total
      FROM civicrm_financial_trxn AS ft
@@ -419,7 +432,11 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    return $result;
  }
 
- function _getFinancialItemAmount($contId) {
+  /**
+   * @param $contId
+   *
+   * @return null|string
+   */function _getFinancialItemAmount($contId) {
    $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
    $query = "SELECT
      SUM(amount)
@@ -430,7 +447,11 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    return $result;
  }
 
- function _getTotalContributedAmount($contId) {
+  /**
+   * @param $contId
+   *
+   * @return null|string
+   */function _getTotalContributedAmount($contId) {
    $query = "SELECT
      SUM(amount)
      FROM civicrm_entity_financial_trxn
@@ -440,7 +461,14 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    return $result;
  }
 
- function _testOfflineContribution($firstName, $lastName, $email, $amount, $status="Completed") {
+  /**
+   * @param $firstName
+   * @param $lastName
+   * @param $email
+   * @param $amount
+   * @param string $status
+   */
+  function _testOfflineContribution($firstName, $lastName, $email, $amount, $status="Completed") {
 
    $this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload");