'household_name' => NULL,
'organization_name' => NULL,
'sic_code' => NULL,
- 'contact_is_deleted' => '0',
- 'current_employer' => NULL,
- 'address_id' => NULL,
- 'street_address' => NULL,
- 'supplemental_address_1' => NULL,
- 'supplemental_address_2' => NULL,
- 'supplemental_address_3' => NULL,
- 'city' => NULL,
- 'postal_code_suffix' => NULL,
- 'postal_code' => NULL,
- 'state_province_id' => NULL,
- 'country_id' => NULL,
- 'phone_id' => '7',
'phone_type_id' => '1',
- 'phone' => '293-6934',
- 'email_id' => '7',
- 'email' => 'daz.alex67@testing.net',
- 'im_id' => NULL,
- 'provider_id' => NULL,
- 'im' => NULL,
- 'worldregion_id' => NULL,
- 'world_region' => NULL,
- 'state_province_name' => NULL,
- 'state_province' => NULL,
- 'country' => NULL,
+ 'phone_primary.phone' => '293-6934',
+ 'email_primary.email' => 'daz.alex67@testing.net',
];
}
'birth_date' => '1999-05-11',
'is_deceased' => '0',
'deceased_date' => NULL,
- 'household_name' => NULL,
'organization_name' => NULL,
- 'sic_code' => NULL,
- 'contact_is_deleted' => '0',
- 'current_employer' => NULL,
- 'address_id' => NULL,
- 'street_address' => NULL,
- 'supplemental_address_1' => NULL,
- 'supplemental_address_2' => NULL,
- 'supplemental_address_3' => NULL,
- 'city' => NULL,
- 'postal_code_suffix' => NULL,
- 'postal_code' => NULL,
- 'geo_code_1' => NULL,
- 'geo_code_2' => NULL,
- 'state_province_id' => NULL,
- 'country_id' => NULL,
- 'phone_id' => '7',
- 'phone_type_id' => '1',
- 'phone' => '393-7924',
- 'email_id' => '7',
- 'email' => 'barb@testing.net',
- 'worldregion_id' => NULL,
- 'world_region' => NULL,
+ 'phone_primary.phone_type_id' => 1,
+ 'phone_primary.phone' => '393-7924',
+ 'email_primary.email' => 'barb@testing.net',
'email_greeting_display' => 'Dear Barb',
'postal_greeting_display' => 'Dear Barb',
];
--- /dev/null
+<?php
+
+namespace Civi\Test\ExampleData\Event;
+
+use Civi\Test\EntityExample;
+
+class PaidEvent extends EntityExample {
+
+ public function getExamples(): iterable {
+ yield [
+ 'name' => 'entity/' . $this->entityName . '/' . $this->getExampleName(),
+ ];
+ }
+
+ public function build(array &$example): void {
+ $example['data'] = [
+ 'id' => 0,
+ 'title' => 'Annual CiviCRM meet',
+ 'summary' => 'If you have any CiviCRM related issues or want to track where CiviCRM is heading, Sign up now',
+ 'description' => 'This event is intended to give brief idea about progress of CiviCRM and giving solutions to common user issues',
+ 'event_type_id' => 1,
+ 'is_public' => TRUE,
+ 'start_date' => 20081021,
+ 'end_date' => '+ 1 month',
+ 'is_online_registration' => TRUE,
+ 'registration_start_date' => 20080601,
+ 'registration_end_date' => '+ 1 month',
+ 'max_participants' => 100,
+ 'event_full_text' => 'Sorry! We are already full',
+ 'is_monetary' => TRUE,
+ 'financial_type_id' => 3,
+ 'is_active' => 1,
+ 'default_role_id' => 1,
+ 'is_show_location' => TRUE,
+ 'is_email_confirm' => 1,
+ 'is_pay_later' => TRUE,
+ 'pay_later_text' => 'Transfer funds',
+ 'pay_later_receipt' => 'Please transfer funds to our bank account.',
+ 'fee_label' => 'Event fees',
+ ];
+ }
+
+}
*
*/
public function _setUpParticipantObjects(string $participantStatus = 'Attended'): void {
- $event = $this->eventCreate(['is_email_confirm' => 1]);
+ $event = $this->eventCreate(['is_email_confirm' => 1, 'email_confirm_text' => '']);
$this->setupContribution();
$this->_eventId = $event['id'];
*/
private function creatEventWithProfile($event): array {
if (empty($event)) {
- $event = $this->eventCreate();
+ $event = $this->eventCreate(['is_monetary' => FALSE]);
$this->createJoinedProfile(['entity_table' => 'civicrm_event', 'entity_id' => $event['id']]);
$this->addUFField($this->ids['UFGroup']['our profile'], 'note', 'Contact', 'Comment');
}
* event#64.
*/
public function testSubmitNonPrimaryEmail(): void {
- $event = $this->eventCreate();
+ $event = $this->eventCreate(['is_monetary' => FALSE]);
$mut = new CiviMailUtils($this, TRUE);
$this->submitForm($event['id'], [
[
*/
protected function submitPaidEvent(array $submitValues = []): void {
$this->dummyProcessorCreate();
- $event = $this->eventCreatePaid(['payment_processor' => [$this->ids['PaymentProcessor']['dummy_live']]]);
+ $event = $this->eventCreatePaid(['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',
event.info_url :' . CRM_Utils_System::url('civicrm/event/info', NULL, TRUE) . '&reset=1&id=1
event.registration_url :' . CRM_Utils_System::url('civicrm/event/register', NULL, TRUE) . '&reset=1&id=1
-event.pay_later_receipt :
+event.pay_later_receipt :Please transfer funds to our bank account.
event.custom_1 :my field
event.confirm_email_text :
';
use Civi\Api4\CustomField;
use Civi\Api4\CustomGroup;
use Civi\Api4\Event;
+use Civi\Api4\ExampleData;
use Civi\Api4\FinancialAccount;
use Civi\Api4\FinancialType;
use Civi\Api4\LineItem;
]);
}
- // set defaults for missing params
- $params = array_merge([
- 'title' => 'Annual CiviCRM meet',
- 'summary' => 'If you have any CiviCRM related issues or want to track where CiviCRM is heading, Sign up now',
- 'description' => 'This event is intended to give brief idea about progress of CiviCRM and giving solutions to common user issues',
- 'event_type_id' => 1,
- 'is_public' => 1,
- 'start_date' => 20081021,
- 'end_date' => '+ 1 month',
- 'is_online_registration' => 1,
- 'registration_start_date' => 20080601,
- 'registration_end_date' => '+ 1 month',
- 'max_participants' => 100,
- 'event_full_text' => 'Sorry! We are already full',
- 'is_monetary' => 0,
- 'is_active' => 1,
- 'default_role_id' => 1,
- 'is_show_location' => 0,
- 'is_email_confirm' => 1,
- ], $params);
+ $params = array_merge($this->getExampleData('Event', 'PaidEvent'), $params);
+
if (!empty($params['payment_processor_id'])) {
$params['payment_processor'] = is_array($params['payment_processor_id']) ? $params['payment_processor_id'] : [$params['payment_processor_id']];
}
}
}
+ /**
+ * Get example data.
+ *
+ * @param string $entity
+ * @param string $name
+ *
+ * @return array
+ * @throws \CRM_Core_Exception
+ */
+ protected function getExampleData(string $entity, string $name): array {
+ $data = ExampleData::get(FALSE)
+ ->addSelect('data')
+ ->addWhere('name', '=', 'entity/' . $entity . '/' . $name)
+ ->execute()->first()['data'];
+ unset($data['id']);
+ return $data;
+ }
+
}
* @throws \CRM_Core_Exception
*/
public function createPendingParticipantContribution() {
- $this->_ids['event']['test'] = $this->eventCreate(['is_email_confirm' => 1, 'confirm_from_email' => 'test@civicrm.org'])['id'];
+ $this->_ids['event']['test'] = $this->eventCreate(['is_email_confirm' => 1, 'confirm_from_email' => 'test@civicrm.org', 'confirm_email_text' => ''])['id'];
$participantID = $this->participantCreate(['event_id' => $this->_ids['event']['test'], 'status_id' => 6, 'contact_id' => $this->individualID]);
$this->_ids['participant'] = $participantID;
$params = array_merge($this->_params, ['contact_id' => $this->individualID, 'contribution_status_id' => 2, 'financial_type_id' => 'Event Fee']);