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 May 28, 2021
1 parent ed642f8 commit 51c24f5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
8 changes: 6 additions & 2 deletions tests/phpunit/CRM/Activity/BAO/ActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,17 @@ public function testRetrieve() {
}

/**
* Test Assigning a target contact but then the logged in user cannot see the contact
* Test Assigning a target contact but then the logged in user cannot see the
* contact
*
* @throws \CiviCRM_API3_Exception
* @throws \CRM_Core_Exception
*/
public function testTargetContactNotavaliable() {
$contactId = $this->individualCreate();
$params = [
'first_name' => 'liz',
'last_name' => 'hurleey',
'last_name' => 'Hurley',
];
$targetContactId = $this->individualCreate($params);

Expand Down
4 changes: 3 additions & 1 deletion tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ public function testIPNPaymentRecurSuccess(): void {
/**
* Test IPN response updates contribution_recur & contribution for first & second contribution.
*
* @throws \API_Exception
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
* @throws \Civi\API\Exception\UnauthorizedException
*/
public function testIPNPaymentMembershipRecurSuccess() {
public function testIPNPaymentMembershipRecurSuccess(): void {
$durationUnit = 'year';
$this->setupMembershipRecurringPaymentProcessorTransaction(['duration_unit' => $durationUnit, 'frequency_unit' => $durationUnit]);
$this->callAPISuccessGetSingle('membership_payment', []);
Expand Down
7 changes: 5 additions & 2 deletions tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* <http://www.gnu.org/licenses/>.
*/

use Civi\Api4\Contribution;
use Civi\Api4\OptionGroup;
use Civi\Api4\RelationshipType;
use Civi\Payment\System;
Expand Down Expand Up @@ -152,7 +153,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 @@ -3630,10 +3631,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']])['values'];
$total = 0;
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 51c24f5

Please sign in to comment.