CRM-15197 Fixed testChangePaymentProcessor in UpdateContributions WebTest
authorMaggie <maggie.epps@gmail.com>
Mon, 15 Sep 2014 18:04:25 +0000 (14:04 -0400)
committerMaggie <maggie.epps@gmail.com>
Mon, 15 Sep 2014 18:04:25 +0000 (14:04 -0400)
tests/phpunit/WebTest/Contribute/UpdateContributionTest.php [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 6188c6a..5b00f5b
@@ -277,7 +277,9 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    $this->select("payment_instrument_id", "label=$label");
    $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
    //Assertions
-   $totalAmount = $this->_getPremiumActualCost($contId, 'Payment Processor Account', 'Accounts Receivable');
+   $subtractedTotal = $this->_getPremiumActualCost($contId, NULL, 'Payment Processor Account');
+   $this->assertEquals($subtractedTotal, -$amount, "Verify amount deleted from old account");
+   $totalAmount = $this->_getPremiumActualCost($contId, NULL, 'Accounts Receivable');
    $this->assertEquals($totalAmount, $amount, "Verify amount for newly inserted values");
  }
 
@@ -420,6 +422,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    if (!empty($cost)) {
      $query .= " AND eft.amount = {$cost}";
    }
+   $query .= " ORDER BY ft.id DESC LIMIT 1";
    $result = CRM_Core_DAO::singleValueQuery($query);
    return $result;
  }