From 4302618d1c9a318da41dc3ba76ee6c872878482e Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 30 Jun 2013 17:15:20 +1200 Subject: [PATCH] stop testing deprecated format_params function & test via the wrapper --- tests/phpunit/api/v3/ContributionTest.php | 36 +++++++++-------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 1f7eeb98b6..f29c9e698c 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -819,6 +819,16 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $result = $this->callAPIFailure($this->_entity, 'create', $params, "'99999' is not a valid option for field financial_type_id"); } + /** + * in the interests of removing financial type / contribution type checks from + * legacy format function lets test that the api is doing this for us + */ + function testValidNamedFinancialType() { + $params = $this->_params; + $params['financial_type_id'] = 'Donation'; + $result = $this->callAPISuccess($this->_entity, 'create', $params); + } + /** * Function tests that additional financial records are created when online contribution with pay later option * is created @@ -1341,28 +1351,10 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $mut->stop(); } - /////////////// _civicrm_contribute_format_params for $create - function testFormatParams() { - $params = array( - 'contact_id' => $this->_individualId, - 'receive_date' => date('Ymd'), - 'total_amount' => 100.00, - 'financial_type_id' => $this->_contributionTypeId, - 'contribution_status_id' => 1, - 'financial_type' => null, - 'note' => 'note', - 'contribution_source' => 'test', - ); - - $values = array(); - $result = _civicrm_api3_contribute_format_params($params, $values, TRUE); - $this->assertEquals($values['total_amount'], 100.00, 'In line ' . __LINE__); - $this->assertEquals($values['contribution_status_id'], 1, 'In line ' . __LINE__); - } - /* - * This function does a GET & compares the result against the $params - * Use as a double check on Creates - */ + /** + * This function does a GET & compares the result against the $params + * Use as a double check on Creates + */ function contributionGetnCheck($params, $id, $delete = 1) { $contribution = civicrm_api('Contribution', 'Get', array( -- 2.25.1