Skip to content

Commit

Permalink
See how many tests fail with this check
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jun 19, 2021
1 parent 254ae8f commit 86d5893
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
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

0 comments on commit 86d5893

Please sign in to comment.