From 4ddaee72d81b4100e2fd0bb0a2e4b71b3b2abc3f Mon Sep 17 00:00:00 2001 From: Maggie Date: Mon, 15 Sep 2014 14:04:25 -0400 Subject: [PATCH] CRM-15197 Fixed testChangePaymentProcessor in UpdateContributions WebTest --- tests/phpunit/WebTest/Contribute/UpdateContributionTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 tests/phpunit/WebTest/Contribute/UpdateContributionTest.php diff --git a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php old mode 100644 new mode 100755 index 6188c6a1dc..5b00f5be6e --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -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; } -- 2.25.1