From e59aadeae955f83a50189aa065b2a17142de8551 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 18 Jun 2021 18:04:11 +1200 Subject: [PATCH] [NFC] Fix up test data Our test data is creating 2 registrations for the same person for the same event on 2 different line items - this isn't valid and it doesn't pass heightened strictness tests --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 22 +++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 473bb1f502..52edac547d 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -3534,7 +3534,6 @@ VALUES * @throws \CRM_Core_Exception */ protected function getParticipantOrderParams(): array { - $this->_contactId = $this->individualCreate(); $event = $this->eventCreate(); $this->_eventId = $event['id']; $eventParams = [ @@ -3544,23 +3543,13 @@ VALUES ]; $this->callAPISuccess('event', 'create', $eventParams); $priceFields = $this->createPriceSet('event', $this->_eventId); - $participantParams = [ - 'financial_type_id' => 4, - 'event_id' => $this->_eventId, - 'role_id' => 1, - 'status_id' => 14, - 'fee_currency' => 'USD', - 'contact_id' => $this->_contactId, - ]; - $participant = $this->callAPISuccess('Participant', 'create', $participantParams); $orderParams = [ 'total_amount' => 300, 'currency' => 'USD', - 'contact_id' => $this->_contactId, + 'contact_id' => $this->individualCreate(), 'financial_type_id' => 4, 'contribution_status_id' => 'Pending', 'contribution_mode' => 'participant', - 'participant_id' => $participant['id'], ]; foreach ($priceFields['values'] as $key => $priceField) { $orderParams['line_items'][] = [ @@ -3577,7 +3566,14 @@ VALUES 'entity_table' => 'civicrm_participant', ], ], - 'params' => $participant, + 'params' => [ + 'financial_type_id' => 4, + 'event_id' => $this->_eventId, + 'role_id' => 1, + 'status_id' => 14, + 'fee_currency' => 'USD', + 'contact_id' => $this->individualCreate(), + ], ]; } return $orderParams; -- 2.25.1