From d1dcfe0dee774cca061e13bd9031db76bd695099 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 6 Jun 2023 10:14:49 +1200 Subject: [PATCH] Switch PaymentFormsTest to new version --- tests/phpunit/CRM/Core/Payment/AuthorizeNetTrait.php | 2 +- tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTrait.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTrait.php index 8c29898191..bddba5fdb2 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTrait.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTrait.php @@ -88,7 +88,7 @@ trait CRM_Core_Payment_AuthorizeNetTrait { * * @param array $expected */ - protected function assertRequestValid($expected = []) { + protected function assertRequestValid(array $expected = []): void { $expected = array_merge([ 'x_card_num' => '4111111111111111', 'x_card_code' => 123, diff --git a/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php b/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php index bf7c16fd2b..d931340a39 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->legacyEventCreatePaid([ + $eventID = $this->eventCreatePaid([ 'end_date' => '+ 1 month', 'registration_end_date' => '+ 1 month', 'payment_processor' => $processors, @@ -54,7 +54,7 @@ class CRM_Financial_Form_PaymentFormsTest extends CiviUnitTestCase { 'controller' => [], 'submitValues' => [ 'event' => [$eventID => ['participant' => [1 => ['email' => 'bob@example.com']]]], - 'event_' . $eventID . '_price_' . $this->ids['PriceField']['event_radio'] => $this->ids['PriceFieldValue']['price_field'], + 'event_' . $eventID . '_price_' . $this->ids['PriceField']['PaidEvent'] => $this->ids['PriceFieldValue']['PaidEvent_standard'], ], 'REQUEST' => [], ], @@ -100,7 +100,7 @@ class CRM_Financial_Form_PaymentFormsTest extends CiviUnitTestCase { ->first(); $this->assertEquals($cart->id, $participant['cart_id']); $this->assertEquals(CRM_Core_PseudoConstant::getKey('CRM_Event_BAO_Participant', 'status_id', 'Registered'), $participant['status_id']); - $this->assertRequestValid(['x_city' => 'The+Shire', 'x_state' => 'IL', 'x_amount' => 1.0]); + $this->assertRequestValid(['x_city' => 'The+Shire', 'x_state' => 'IL', 'x_amount' => 300.0]); } } -- 2.25.1