From 4371d572b1ec020bc44e44f7f626702b61b2c167 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 15 Sep 2021 16:24:25 -0700 Subject: [PATCH] (REF) Extract example "entity/Contact/Alex" from "workflow/generic/Alex" --- Civi/Test/ExampleData/Contact/Alex.ex.php | 85 +++++++++++++++++++ .../GenericWorkflowMessage/Alex.ex.php | 70 +-------------- 2 files changed, 86 insertions(+), 69 deletions(-) create mode 100644 Civi/Test/ExampleData/Contact/Alex.ex.php diff --git a/Civi/Test/ExampleData/Contact/Alex.ex.php b/Civi/Test/ExampleData/Contact/Alex.ex.php new file mode 100644 index 0000000000..ebb2e78296 --- /dev/null +++ b/Civi/Test/ExampleData/Contact/Alex.ex.php @@ -0,0 +1,85 @@ + "entity/{$this->entityName}/{$this->exName}", + ]; + } + + public function build(array &$example): void { + $example['data'] = [ + 'contact_id' => '100', + 'contact_type' => 'Individual', + 'contact_sub_type' => NULL, + 'sort_name' => 'D\u00edaz, Alex', + 'display_name' => 'Dr. Alex D\u00edaz', + 'do_not_email' => '1', + 'do_not_phone' => '1', + 'do_not_mail' => '0', + 'do_not_sms' => '0', + 'do_not_trade' => '0', + 'is_opt_out' => '0', + 'legal_identifier' => NULL, + 'external_identifier' => NULL, + 'nick_name' => NULL, + 'legal_name' => NULL, + 'image_URL' => NULL, + 'preferred_communication_method' => NULL, + 'preferred_language' => NULL, + 'preferred_mail_format' => 'Both', + 'first_name' => 'Alex', + 'middle_name' => '', + 'last_name' => 'D\u00edaz', + 'prefix_id' => '4', + 'suffix_id' => NULL, + 'formal_title' => NULL, + 'communication_style_id' => NULL, + 'job_title' => NULL, + 'gender_id' => '1', + 'birth_date' => '1994-04-21', + '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' => '293-6934', + 'email_id' => '7', + 'email' => 'daz.alex67@testing.net', + 'on_hold' => '0', + 'im_id' => NULL, + 'provider_id' => NULL, + 'im' => NULL, + 'worldregion_id' => NULL, + 'world_region' => NULL, + 'languages' => NULL, + 'individual_prefix' => 'Dr.', + 'individual_suffix' => NULL, + 'communication_style' => NULL, + 'gender' => 'Female', + 'state_province_name' => NULL, + 'state_province' => NULL, + 'country' => NULL, + ]; + } + +} diff --git a/Civi/WorkflowMessage/GenericWorkflowMessage/Alex.ex.php b/Civi/WorkflowMessage/GenericWorkflowMessage/Alex.ex.php index 5a7ba7d437..be869b0c95 100644 --- a/Civi/WorkflowMessage/GenericWorkflowMessage/Alex.ex.php +++ b/Civi/WorkflowMessage/GenericWorkflowMessage/Alex.ex.php @@ -20,75 +20,7 @@ class Alex extends \Civi\WorkflowMessage\WorkflowMessageExample { public function build(array &$example): void { $example['data'] = [ 'modelProps' => [ - 'contact' => [ - 'contact_id' => '100', - 'contact_type' => 'Individual', - 'contact_sub_type' => NULL, - 'sort_name' => 'D\u00edaz, Alex', - 'display_name' => 'Dr. Alex D\u00edaz', - 'do_not_email' => '1', - 'do_not_phone' => '1', - 'do_not_mail' => '0', - 'do_not_sms' => '0', - 'do_not_trade' => '0', - 'is_opt_out' => '0', - 'legal_identifier' => NULL, - 'external_identifier' => NULL, - 'nick_name' => NULL, - 'legal_name' => NULL, - 'image_URL' => NULL, - 'preferred_communication_method' => NULL, - 'preferred_language' => NULL, - 'preferred_mail_format' => 'Both', - 'first_name' => 'Alex', - 'middle_name' => '', - 'last_name' => 'D\u00edaz', - 'prefix_id' => '4', - 'suffix_id' => NULL, - 'formal_title' => NULL, - 'communication_style_id' => NULL, - 'job_title' => NULL, - 'gender_id' => '1', - 'birth_date' => '1994-04-21', - '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' => '293-6934', - 'email_id' => '7', - 'email' => 'daz.alex67@testing.net', - 'on_hold' => '0', - 'im_id' => NULL, - 'provider_id' => NULL, - 'im' => NULL, - 'worldregion_id' => NULL, - 'world_region' => NULL, - 'languages' => NULL, - 'individual_prefix' => 'Dr.', - 'individual_suffix' => NULL, - 'communication_style' => NULL, - 'gender' => 'Female', - 'state_province_name' => NULL, - 'state_province' => NULL, - 'country' => NULL, - ], + 'contact' => \Civi\Test::example('entity/Contact/Alex'), ], ]; } -- 2.25.1