-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix test to use valid financials #20956
Conversation
(Standard links)
|
27355f0
to
8814417
Compare
* | ||
* @var bool | ||
*/ | ||
protected $isValidateFinancialsOnPostAssert = TRUE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This opts in the whole class, and then we opt out the 1 test it doesn't work for
*/ | ||
protected function assertPostConditions(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These asserts are now done by the parent if $isValidateFinancialsOnPostAssert = TRUE;
is true
Ideally we opt in the class & opt out specific tests as an interim. Moving towards opt in everything & opt out specific tests
8814417
to
db92bcb
Compare
@@ -3468,8 +3468,6 @@ public function testCompleteTransactionMembershipPriceSet() { | |||
* @throws \CiviCRM_API3_Exception | |||
*/ | |||
public function testPendingToCompleteContribution(): void { | |||
// @todo - figure out why this test is not valid. | |||
$this->isValidateFinancialsOnPostAssert = FALSE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works because of the fix below
public function testAssignProportionalLineItems() { | ||
public function testAssignProportionalLineItems(): void { | ||
// This test doesn't seem to manage financials properly, possibly by design | ||
$this->isValidateFinancialsOnPostAssert = FALSE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this get reset for the tests that come after it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seamuslee001 yep - I just put in a break point in the next test &
This seems fine to me, just want to confirm that the postAssert is properly reset for the other tests in the ContributionTest class |
Overview
Fix test to use valid financials
Before
Creates contributions and then line items, resulting in invalid financial data in the test set up
After
uses order api
Technical Details
Comments