-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
[NFC] {Test} Minor cleanup #21116
Merged
Merged
[NFC] {Test} Minor cleanup #21116
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,8 +73,6 @@ class api_v3_ContributionTest extends CiviUnitTestCase { | |
|
||
/** | ||
* Setup function. | ||
* | ||
* @throws \CiviCRM_API3_Exception | ||
*/ | ||
public function setUp(): void { | ||
parent::setUp(); | ||
|
@@ -120,8 +118,8 @@ public function setUp(): void { | |
/** | ||
* Clean up after each test. | ||
* | ||
* @throws \API_Exception | ||
* @throws \CRM_Core_Exception | ||
* @throws \CiviCRM_API3_Exception | ||
*/ | ||
public function tearDown(): void { | ||
$this->quickCleanUpFinancialEntities(); | ||
|
@@ -144,8 +142,6 @@ public function tearDown(): void { | |
|
||
/** | ||
* Test Get. | ||
* | ||
* @throws \CRM_Core_Exception | ||
*/ | ||
public function testGetContribution(): void { | ||
$this->enableTaxAndInvoicing(); | ||
|
@@ -280,8 +276,6 @@ public function testCreateCheckContribution(): void { | |
|
||
/** | ||
* Test the 'return' param works for all fields. | ||
* | ||
* @throws \CRM_Core_Exception | ||
*/ | ||
public function testGetContributionReturnFunctionality(): void { | ||
$params = $this->_params; | ||
|
@@ -316,7 +310,7 @@ public function testGetContributionReturnFunctionality(): void { | |
// update contribution with invoice number | ||
$params = array_merge($params, [ | ||
'id' => $contributionID, | ||
'invoice_number' => CRM_Utils_Array::value('invoice_prefix', Civi::settings()->get('contribution_invoice_settings')) . "" . $contributionID, | ||
'invoice_number' => Civi::settings()->get('invoice_prefix') . $contributionID, | ||
'trxn_id' => 12345, | ||
'invoice_id' => 6789, | ||
]); | ||
|
@@ -1288,7 +1282,7 @@ public function testCreateContributionPendingOnline() { | |
$this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345); | ||
$this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890); | ||
$this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF'); | ||
$this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2); | ||
$this->assertEquals(2, $contribution['values'][$contribution['id']]['contribution_status_id']); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK - I realise all the lines above need the same change - I decided after the first one not to get carried away |
||
$this->_checkFinancialRecords($contribution, 'pending'); | ||
} | ||
|
||
|
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.
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.
I can see the original was copy/paste from elsewhere, hence the extra
. ""
. In other languages I've seen sometimes you need to do this type of thing to force string, since maybe a prefix like0001
got output as just1
, although that doesn't seem to be true in php. But maybe something along those lines, I just can't think what.But specifically for this test, isn't the prefix always null and known to be such? Not a blocker just was probably also part of copy/paste in the original.
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.
@demeritcowboy yeah I guess if I'd thought it through further I would have removed it