Add unit test to date parsing on import
authoreileen <emcnaughton@wikimedia.org>
Thu, 14 Mar 2019 21:08:02 +0000 (10:08 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 14 Mar 2019 22:45:53 +0000 (11:45 +1300)
commit1004b68954fca664cca58f448aa999558e84a941
treeb88c6b546ddb9b1407a7533ba1729500f9c2d273
parentbc07dc0007b7bb399897acc60819b5ebdf0133bd
Add unit test to date parsing on import

This is primarily as a demo of how to test this class.

Basically extract the parts that we want to check the formatting of into manageable
functions. I made the name on the second one pretty generic so slowly all formatting can
be moved into it, with testing.

This would include moving the various bits of work done in
_civicrm_api3_deprecated_formatted_param
into this function - that code really does just belong on this class as it
is not called from anywhere else.

It also does the checking, but not the formatting, for these date fields - sigh

I would have liked to have made the method protected but the mucking around that required
in the test classes didn't seem to justify it
CRM/Contribute/Import/Parser/Contribution.php
tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php