X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fapi%2Fv3%2FContributionTest.php;h=6dd0d2b705a9ba54073a8484d922f5e0880ab2db;hb=4750ab016d04483cb152df393d09dad3dcf1cc4a;hp=ff112c9dfbca6d82e9ea2974aba3bd2c1405dc6c;hpb=d1c0c69c2308d8582cc135df5f40688768c6b11b;p=civicrm-core.git diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index ff112c9dfb..6dd0d2b705 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -682,15 +682,26 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** * Create test with unique field name on source. + * + * @param string $thousandSeparator + * punctuation used to refer to thousands. + * + * @dataProvider getThousandSeparators */ - public function testCreateDefaultNow() { - + public function testCreateDefaultNow($thousandSeparator) { + $this->setCurrencySeparators($thousandSeparator); $params = $this->_params; - unset($params['receive_date']); + unset($params['receive_date'], $params['net_amount']); + + $params['total_amount'] = $this->formatMoneyInput(5000.77); + $params['fee_amount'] = $this->formatMoneyInput(.77); $contribution = $this->callAPISuccess('contribution', 'create', $params); $contribution = $this->callAPISuccessGetSingle('contribution', array('id' => $contribution['id'])); $this->assertEquals(date('Y-m-d'), date('Y-m-d', strtotime($contribution['receive_date']))); + $this->assertEquals(5000.77, $contribution['total_amount'], 'failed to handle ' . $this->formatMoneyInput(5000.77)); + $this->assertEquals(.77, $contribution['fee_amount']); + $this->assertEquals(5000, $contribution['net_amount']); } /**