Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
4302618d
Commit
4302618d
authored
11 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
stop testing deprecated format_params function & test via the wrapper
parent
d4251d65
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/phpunit/api/v3/ContributionTest.php
+14
-22
14 additions, 22 deletions
tests/phpunit/api/v3/ContributionTest.php
with
14 additions
and
22 deletions
tests/phpunit/api/v3/ContributionTest.php
+
14
−
22
View file @
4302618d
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment