From 7f0dd4025376605c9d441caeba1bbd4f541807f2 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 6 Jun 2023 10:04:45 +1200 Subject: [PATCH] Rename the test function I am replacing The eventTrait has a new version of eventCreatePaid but it can't be called because these tests still rely on an older variant (which creates invalid financial records) - this moves that function out of the way to allow me to work through migrating over --- tests/phpunit/CRM/Contribute/BAO/ContributionTest.php | 2 +- tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php | 2 +- tests/phpunit/CRM/Event/Form/ParticipantTest.php | 2 +- tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php | 4 ++-- tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php | 2 +- tests/phpunit/CiviTest/CiviUnitTestCase.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php index 1edc9c8df5..d973ad5141 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php @@ -614,7 +614,7 @@ WHERE eft.entity_id = %1 AND ft.to_financial_account_id <> %2"; public function addParticipantWithContribution() { // creating price set, price field $this->_contactId = $this->individualCreate(); - $event = $this->eventCreatePaid([]); + $event = $this->legacyEventCreatePaid([]); $this->_eventId = $event['id']; $priceSetID = $this->ids['PriceSet']['event']; $paramsField = [ diff --git a/tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php b/tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php index 76475604cc..e4322ead22 100644 --- a/tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php +++ b/tests/phpunit/CRM/Contribute/Form/Task/InvoiceTest.php @@ -109,7 +109,7 @@ class CRM_Contribute_Form_Task_InvoiceTest extends CiviUnitTestCase { $this->enableTaxAndInvoicing(); - $event = $this->eventCreatePaid([]); + $event = $this->legacyEventCreatePaid([]); $individualOneId = $this->individualCreate(); $individualTwoId = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Event/Form/ParticipantTest.php b/tests/phpunit/CRM/Event/Form/ParticipantTest.php index 86dd209864..6cd0a03954 100644 --- a/tests/phpunit/CRM/Event/Form/ParticipantTest.php +++ b/tests/phpunit/CRM/Event/Form/ParticipantTest.php @@ -353,7 +353,7 @@ class CRM_Event_Form_ParticipantTest extends CiviUnitTestCase { if (!empty($eventParams['is_monetary'])) { $phone = Phone::create()->setValues(['phone' => 1235, 'phone_type_id:name' => 'Mobile', 'phone_ext' => 456])->execute()->first(); $locationBlockID = LocBlock::create()->setValues(['phone_id' => $phone['id']])->execute()->first()['id']; - $event = $this->eventCreatePaid(array_merge([ + $event = $this->legacyEventCreatePaid(array_merge([ 'name' => 'big', 'amount' => 1550.55, 'loc_block_id' => $locationBlockID, diff --git a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php index 2b635db9fe..3cfad06593 100644 --- a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php +++ b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php @@ -177,7 +177,7 @@ class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase { $processor = Civi\Payment\System::singleton()->getById($paymentProcessorID); $processor->setDoDirectPaymentResult(['fee_amount' => 1.67]); $params = ['is_monetary' => 1, 'financial_type_id' => 1]; - $event = $this->eventCreatePaid($params, [['name' => 'test', 'amount' => 8000.67]]); + $event = $this->legacyEventCreatePaid($params, [['name' => 'test', 'amount' => 8000.67]]); $individualID = $this->individualCreate(); //$this->submitForm($event['id'], [ $form = CRM_Event_Form_Registration_Confirm::testSubmit([ @@ -704,7 +704,7 @@ class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase { */ protected function submitPaidEvent(array $submitValues = []): void { $this->dummyProcessorCreate(); - $event = $this->eventCreatePaid(['payment_processor' => [$this->ids['PaymentProcessor']['dummy_live']], 'confirm_email_text' => '', 'is_pay_later' => FALSE]); + $event = $this->legacyEventCreatePaid(['payment_processor' => [$this->ids['PaymentProcessor']['dummy_live']], 'confirm_email_text' => '', 'is_pay_later' => FALSE]); $this->submitForm($event['id'], array_merge([ 'email-Primary' => 'demo@example.com', 'credit_card_number' => '4111111111111111', diff --git a/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php b/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php index 61ea1420e5..bf7c16fd2b 100644 --- a/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php +++ b/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php @@ -41,7 +41,7 @@ class CRM_Financial_Form_PaymentFormsTest extends CiviUnitTestCase { public function testEventPaymentForms(): void { $this->createAuthorizeNetProcessor(); $processors = [$this->ids['PaymentProcessor']['anet']]; - $eventID = $this->eventCreatePaid([ + $eventID = $this->legacyEventCreatePaid([ 'end_date' => '+ 1 month', 'registration_end_date' => '+ 1 month', 'payment_processor' => $processors, diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index dcd280d78c..aee9d9fa68 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -1064,7 +1064,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { * * @return array */ - protected function eventCreatePaid(array $params = [], array $options = [['name' => 'hundred', 'amount' => 100]], string $key = 'event'): array { + protected function legacyEventCreatePaid(array $params = [], array $options = [['name' => 'hundred', 'amount' => 100]], string $key = 'event'): array { // @todo - uncomment these - but need to fix an e-notice first. // $this->dummyProcessorCreate(); // $params['payment_processor'] = [$this->ids['PaymentProcessor']['dummy_live']]; -- 2.25.1