CRM-21682 Membership Renewal Tests #11824
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Existing membership renewal tests are testing renewals where duration units don't match (ie. recur has a monthly interval but membership has a yearly interval). This is an unlikely real-world scenario as it would lead to an annual membership being renewed by a year every month that the recurring contribution is renewed!
This PR updates the existing unit tests so they use matching frequencies for membership and recurring contributions. It then extends those tests so the same tests can be run with different frequencies, improving overall test coverage.
Before
Tests are not testing a valid real-world scenario (It might be nice to pay in monthly installments for an annual membership but that's not what the code is testing and is not how it currently works).
After
Test coverage is improved. Real-world renewal scenarios are tested.
Comments
Improve test coverage to support changes in #11556.