Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/280763
Change subject: [WIP] Try to fix missing exchange rate fixtures
......................................................................
[WIP] Try to fix missing exchange rate fixtures
There's still a problem, however. Lazily committing to see what CI says.
Change-Id: Ib58276d516fc2c5ea3727865585bfcbf6e6a7161
---
M sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm
refs/changes/63/280763/1
diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
b/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
index 92c0c6e..50b296c 100644
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
@@ -219,6 +219,10 @@
* Make a lesser refund in the wrong currency
*/
public function testLesserWrongCurrencyRefund() {
+ $strtime = '04/03/2000';
+ $dbtime = '2000-04-03';
+ $epochtime = wmf_common_date_parse_string( $dbtime );
+ $this->setExchangeRates( $epochtime, array( 'USD' => 1, 'COP' => 100 ) );
$result = $this->callAPISuccess('contribution', 'create', array(
'contact_id' => $this->contact_id,
@@ -232,7 +236,7 @@
$result['id'],
'refund',
TRUE,
- date('Y-m-d'),
+ $dbtime,
NULL,
'COP',
5000
@@ -246,7 +250,7 @@
$this->assertEquals(5.95, $contributions['values'][1]['total_amount']);
$this->assertEquals('USD', $contributions['values'][2]['currency']);
// Exchange rates might move a bit but hopefully it stays less than the
original amount.
- $this->assertTRUE($contributions['values'][2]['total_amount'] <
exchange_rate_convert('COP', 5.95, wmf_common_date_parse_string('now')));
+ $this->assertEquals($contributions['values'][2]['total_amount'], 5.95 *
100);
}
}
--
To view, visit https://gerrit.wikimedia.org/r/280763
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib58276d516fc2c5ea3727865585bfcbf6e6a7161
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits