From 65e5f7f6a12162c3117388675ce41c3f75deb0a1 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 7 Jun 2023 12:33:06 +1200 Subject: [PATCH] Fix a couple of tests to use Event helpers --- tests/phpunit/CRM/Core/CopyTest.php | 2 +- tests/phpunit/CRM/Event/BAO/QueryTest.php | 4 ++-- tests/phpunit/api/v3/ContributionTest.php | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/CRM/Core/CopyTest.php b/tests/phpunit/CRM/Core/CopyTest.php index a556bb4751..6881796f0e 100644 --- a/tests/phpunit/CRM/Core/CopyTest.php +++ b/tests/phpunit/CRM/Core/CopyTest.php @@ -73,7 +73,7 @@ class CRM_Core_CopyTest extends CiviUnitTestCase { $cleanup = $this->useMultilingual(['en_US' => ['fr_CA', 'nl_NL']]); CRM_Core_I18n::singleton()->setLocale('en_US'); - $event = $this->eventCreate(); + $event = $this->eventCreatePaid(); $eventId = $event['id']; $eventData = civicrm_api3('Event', 'getsingle', ['id' => $eventId]); diff --git a/tests/phpunit/CRM/Event/BAO/QueryTest.php b/tests/phpunit/CRM/Event/BAO/QueryTest.php index 0e1e087188..89ae38ba9c 100644 --- a/tests/phpunit/CRM/Event/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Event/BAO/QueryTest.php @@ -15,7 +15,7 @@ class CRM_Event_BAO_QueryTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception */ public function testParticipantNote() { - $event = $this->eventCreate(); + $event = $this->eventCreateUnpaid(); $this->individualCreate([ 'api.participant.create' => [ 'event_id' => $event['id'], @@ -50,7 +50,7 @@ class CRM_Event_BAO_QueryTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception */ public function testEventType() { - $event = $this->eventCreate(); + $event = $this->eventCreateUnpaid(); $contactId = $this->individualCreate([ 'api.participant.create' => [ 'event_id' => $event['id'], diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index d1dc613bcd..3b57c25f23 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -4284,7 +4284,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * @return array|int * @throws \CRM_Core_Exception */ - protected function setUpRecurringContribution($generalParams = [], $recurParams = []) { + protected function setUpRecurringContribution(array $generalParams = [], $recurParams = []) { $contributionRecur = $this->callAPISuccess('contribution_recur', 'create', array_merge([ 'contact_id' => $this->individualID, 'installments' => '12', @@ -4303,8 +4303,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'contribution_status_id' => 'Pending', ], $generalParams); $contributionParams['api.Payment.create'] = ['total_amount' => $contributionParams['total_amount']]; - $originalContribution = $this->callAPISuccess('Order', 'create', $contributionParams); - return $originalContribution; + return $this->callAPISuccess('Order', 'create', $contributionParams); } /** -- 2.25.1