#4020 - Points unit test

Identifier #4020
Issue type Feature request or suggestion
Title Points unit test
Status Completed
Tags

Roadmap: v11 (custom)

Handling member Chris Graham
Addon General / Uncategorised
Description There is currently no direct unit testing for the points system.

Test giving points ('give_points' function) to member #2 and that those points raise what the API claims are the total points for that member by the expected amount. Test that 'get_gift_points_used' goes up for get_member() as expected and 'get_gift_points_to_give' goes down as expected.

Test creating a forum post by member #2 and that the total points is also raised as expected.

Test 'system_gift_transfer' also gives points as expected.

As above, but a negative transfer takes as expected.

Test 'charge_member' deducts points as expected.

As above, but a negative charge gives as expected.

Modify the 'give_points' function to return the ID number of the new gifts table record. Then test that after giving points using 'give_points' and then calling the 'reverse_point_gift_transaction' function on the returned ID, that the points total is unchanged from where it started.
Steps to reproduce

Additional information This should do a fairly broad testing that the points system is doing the basic things expected. You could go much deeper, but that would require refactoring the code to be more testable and is not worth it at this advanced stage IMO.
Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated