Skip to content
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

Try validate financials again - see how we are progressing #20531

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

use Civi\Api4\CustomField;
use Civi\Api4\CustomGroup;
use Civi\Api4\Contribution;
use Civi\Api4\OptionGroup;
use Civi\Api4\RelationshipType;
use Civi\Payment\System;
Expand Down Expand Up @@ -155,7 +156,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase {
*
* @var bool
*/
protected $isValidateFinancialsOnPostAssert = FALSE;
protected $isValidateFinancialsOnPostAssert = TRUE;

/**
* Should location types be checked to ensure primary addresses are correctly assigned after each test.
Expand Down Expand Up @@ -3626,10 +3627,12 @@ protected function validateAllPayments() {
/**
* Validate all created contributions.
*
* @throws \API_Exception
* @throws \CRM_Core_Exception
* @throws \Civi\API\Exception\UnauthorizedException
*/
protected function validateAllContributions(): void {
$contributions = $this->callAPISuccess('Contribution', 'get', ['return' => ['tax_amount', 'total_amount']])['values'];
$contributions = Contribution::get(FALSE)->setSelect(['total_amount', 'tax_amount'])->execute();
foreach ($contributions as $contribution) {
$lineItems = $this->callAPISuccess('LineItem', 'get', [
'contribution_id' => $contribution['id'],
Expand Down
10 changes: 10 additions & 0 deletions tests/phpunit/api/v3/SyntaxConformanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
protected $_apiversion = 3;

/**
* Do not check financial entities in this test class.
*
* The class uses lots of crud to do things by-passing
* BAO logic & entities are often not valid as a result.
*
* @var bool
*/
protected $isValidateFinancialsOnPostAssert = FALSE;

/**
* @var array
* e.g. $this->deletes['CRM_Contact_DAO_Contact'][] = $contactID;
Expand Down