[NFC] Convert Payment Processor ID field to payment processor in event create in...
authorSeamus Lee <seamuslee001@gmail.com>
Sun, 14 Aug 2022 23:02:52 +0000 (09:02 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Sun, 14 Aug 2022 23:02:52 +0000 (09:02 +1000)
tests/phpunit/CiviTest/CiviUnitTestCase.php

index 567d4fe047bb875f8988b51b7be9ccbef4586e9c..b833c7253176a940b22fb4f806b7794512842e78 100644 (file)
@@ -1137,7 +1137,9 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase {
       'is_show_location' => 0,
       'is_email_confirm' => 1,
     ], $params);
-
+    if (!empty($params['payment_processor_id'])) {
+      $params['payment_processor'] = is_array($params['payment_processor_id']) ? $params['payment_processor_id'] : [$params['payment_processor_id']];
+    }
     $event = Event::create(FALSE)->setValues($params)->execute()->first();
     $this->ids['event'][] = $event['id'];
     return $event;