[REF] calculate 'amount' on ContributionPage in a shared way in one scenario
authoreileen <emcnaughton@wikimedia.org>
Mon, 11 Nov 2019 04:47:15 +0000 (17:47 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 12 Nov 2019 09:19:54 +0000 (22:19 +1300)
commitec57bf8741042cc600a7d0daa38b514700fbce88
tree6c00bc146dfcf1a819cc460e0581210741b4d589
parentaa301f1cd0f11c166d4ca391e55b8e02ec9636a5
[REF] calculate 'amount' on ContributionPage in a shared way in one scenario

I have discovered a lot of tests are creating invalid contributions - https://github.com/civicrm/civicrm-core/pull/15706

So far the issues have been in the test + us permitting something that doesn't work on the form - ie https://github.com/civicrm/civicrm-core/pull/15771

I'm trying to work through them all & then we can ideally validate payments in general. In this case
it turns out that because 'amount' is currently a 'required' parameter the tests have 'any value' stuck in there.
In a real submission it would be calculated so I'm trying to share the code that would do that with
the path used by the test (& in this case the api) and to move towards getting the tests valid
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Contribute/Form/Contribution/Main.php
CRM/Contribute/Form/ContributionBase.php
tests/phpunit/api/v3/ContributionPageTest.php