✔️ add UnitTests
This commit is contained in:
parent
7b30a75014
commit
1954f90f79
4 changed files with 417 additions and 2 deletions
136
tests/resources/twingle_project_bad_dummy.php
Normal file
136
tests/resources/twingle_project_bad_dummy.php
Normal file
|
@ -0,0 +1,136 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
"id" => 2243,
|
||||
"internal_id" => NULL,
|
||||
"name" => "TestProject",
|
||||
"organisation_id" => 555,
|
||||
"slug" => "test_project",
|
||||
"identifier" => "tw5555555555555",
|
||||
"type" => "event",
|
||||
"transaction_type" => NULL,
|
||||
"project_target" => 1000,
|
||||
"image_directory" => NULL,
|
||||
"allow_more" => FALSE,
|
||||
"last_update" => 1614166801,
|
||||
"embed" => [
|
||||
"page" => "https://spenden.twingle.de/my-awesome-ngo/testprojekt/tw555555a555555c/page",
|
||||
"eventpage" => "https://my-awesome-ngo/event/testprojekt/tw555555a555555c/edit",
|
||||
"widget" => "<!-- twingle --><!-- twingle -->",
|
||||
"form" => "<!-- twingle --><!-- twingle -->",
|
||||
"widget-single" => "<!-- twingle --><!-- twingle -->",
|
||||
"form-single" => "<!-- twingle --><!-- twingle -->",
|
||||
"eventall" => "<!-- twingle --><!-- twingle -->",
|
||||
"eventlist" => "<!-- twingle --><!-- twingle -->",
|
||||
"eventeditcreate" => "<!-- twingle --><!-- twingle -->",
|
||||
"giftdonationexample" => "https://spenden.twingle.de/gift/my-awesome-ngo/tw555555a555555c/example",
|
||||
"letterexample" => "https://spenden.twingle.de/letter/my-awesome-ngo/tw555555a555555c/example",
|
||||
],
|
||||
"counter-url" => [
|
||||
"url" => "https://donationstatus.twingle.de/donation-status/555aaa",
|
||||
],
|
||||
"host" => "https://spenden.twingle.de/",
|
||||
"project_options" => [
|
||||
"id" => 2237,
|
||||
"has_confirmation_mail" => FALSE,
|
||||
"has_confirmation_mail_api" => FALSE,
|
||||
"has_donation_receipt" => TRUE,
|
||||
"has_contact_data" => FALSE,
|
||||
"donation_rhythm" => [
|
||||
"yearly" => TRUE,
|
||||
"halfyearly" => FALSE,
|
||||
"quarterly" => TRUE,
|
||||
"monthly" => TRUE,
|
||||
"one_time" => TRUE,
|
||||
],
|
||||
"default_rhythm" => "",
|
||||
"has_newsletter_registration" => FALSE,
|
||||
"has_postinfo_registration" => FALSE,
|
||||
"design_background_color" => "not_a_hex", // not a hex
|
||||
"design_primary_color" => "green", // no hex either
|
||||
"design_font" => "",
|
||||
"design_font_color" => "true", // no hex either
|
||||
"design_button_font_color" => "",
|
||||
"design_button_font_color_light" => "",
|
||||
"image" => "",
|
||||
"bcc_email_address" => "mustermann@awesome", // no valid email
|
||||
"donation_value_min" => 50, // higher than max
|
||||
"donation_value_max" => 10,
|
||||
"donation_value_default" => 30, // higher than max, lower than min
|
||||
"exclude_contact_fields" => "company,birthday,telephone",
|
||||
"mandatory_contact_fields" => "firstname,lastname",
|
||||
"custom_js" => NULL,
|
||||
"custom_css" => "",
|
||||
"share_url" => "not_a_url", // no valid url
|
||||
"has_contact_mandatory" => FALSE,
|
||||
"has_doi" => TRUE,
|
||||
"doi_redirect" => NULL,
|
||||
"has_force_donation_target_buttons" => FALSE,
|
||||
"has_show_single_target" => FALSE,
|
||||
"betterpayment_credit_card_theme" => NULL,
|
||||
"app_js" => NULL,
|
||||
"slidericon" => "handshake",
|
||||
"extra_field" => [],
|
||||
"has_hidden_logo" => FALSE,
|
||||
"has_projecttarget_as_money" => FALSE,
|
||||
"rapidmail_recipient_list" => NULL,
|
||||
"mailchimp_recipient_list" => NULL,
|
||||
"has_mailchimp_add_all_user" => NULL,
|
||||
"has_mail_hide_paymentblock" => FALSE,
|
||||
"has_mail_hide_paymentblock_api" => FALSE,
|
||||
"cleverreach_group_id" => NULL,
|
||||
"cleverreach_form_id" => NULL,
|
||||
"has_donationtarget_textfield" => FALSE,
|
||||
"has_civi_crm_activated" => FALSE,
|
||||
"has_step_index" => FALSE,
|
||||
"gift_donation" => "",
|
||||
"gift_donation_icon" => NULL,
|
||||
"gift_donation_image" => NULL,
|
||||
"languages" => "de",
|
||||
"has_buttons" => FALSE,
|
||||
"has_no_slider" => FALSE,
|
||||
"buttons" => [
|
||||
"button1" => [
|
||||
"amount" => "5",
|
||||
],
|
||||
"button2" => [
|
||||
"amount" => "50",
|
||||
],
|
||||
"button3" => [
|
||||
"amount" => "100",
|
||||
],
|
||||
"button4" => [
|
||||
"amount" => "",
|
||||
],
|
||||
],
|
||||
"has_newsletter_namerequest" => FALSE,
|
||||
"has_show_donator_data" => FALSE,
|
||||
"has_donation_letter" => FALSE,
|
||||
"has_donation_letter_api" => FALSE,
|
||||
"amount_images" => [],
|
||||
"video_url" => NULL,
|
||||
],
|
||||
"payment_methods" => [
|
||||
"has_paypal" => TRUE,
|
||||
"has_betterpayment" => FALSE,
|
||||
"has_sixpay" => FALSE,
|
||||
"has_banktransfer" => TRUE,
|
||||
"has_debit" => TRUE,
|
||||
"has_sofortueberweisung" => FALSE,
|
||||
"has_betterpayment_creditcard" => FALSE,
|
||||
"has_mbe4" => FALSE,
|
||||
"has_generic" => FALSE,
|
||||
"has_konfipay" => FALSE,
|
||||
"has_konfipay_recurring" => FALSE,
|
||||
"has_betterpayment_creditcard_recurring" => FALSE,
|
||||
"has_paypal_recurring" => FALSE,
|
||||
"has_debit_recurring" => TRUE,
|
||||
"has_generic_recurring" => FALSE,
|
||||
"has_sixpay_recurring" => FALSE,
|
||||
"has_apple_pay" => FALSE,
|
||||
"has_apple_pay_recurring" => FALSE,
|
||||
"has_paydirekt" => FALSE,
|
||||
"has_paydirekt_recurring" => FALSE,
|
||||
],
|
||||
];
|
||||
|
137
tests/resources/twingle_project_dummy.php
Normal file
137
tests/resources/twingle_project_dummy.php
Normal file
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
"id" => 2243,
|
||||
"internal_id" => NULL,
|
||||
"name" => "TestProject",
|
||||
"organisation_id" => 555,
|
||||
"slug" => "test_project",
|
||||
"identifier" => "tw5555555555555",
|
||||
"type" => "event",
|
||||
"transaction_type" => NULL,
|
||||
"project_target" => 1000,
|
||||
"image_directory" => NULL,
|
||||
"allow_more" => FALSE,
|
||||
"last_update" => 1614166801,
|
||||
"embed" => [
|
||||
"page" => "https://spenden.twingle.de/my-awesome-ngo/testprojekt/tw555555a555555c/page",
|
||||
"eventpage" => "https://my-awesome-ngo/event/testprojekt/tw555555a555555c/edit",
|
||||
"widget" => "<!-- twingle --><!-- twingle -->",
|
||||
"form" => "<!-- twingle --><!-- twingle -->",
|
||||
"widget-single" => "<!-- twingle --><!-- twingle -->",
|
||||
"form-single" => "<!-- twingle --><!-- twingle -->",
|
||||
"eventall" => "<!-- twingle --><!-- twingle -->",
|
||||
"eventlist" => "<!-- twingle --><!-- twingle -->",
|
||||
"eventeditcreate" => "<!-- twingle --><!-- twingle -->",
|
||||
"giftdonationexample" => "https://spenden.twingle.de/gift/my-awesome-ngo/tw555555a555555c/example",
|
||||
"letterexample" => "https://spenden.twingle.de/letter/my-awesome-ngo/tw555555a555555c/example",
|
||||
],
|
||||
"counter-url" => [
|
||||
"url" => "https://donationstatus.twingle.de/donation-status/555aaa",
|
||||
],
|
||||
"host" => "https://spenden.twingle.de/",
|
||||
"project_options" => [
|
||||
"id" => 2237,
|
||||
"has_confirmation_mail" => FALSE,
|
||||
"has_confirmation_mail_api" => FALSE,
|
||||
"has_donation_receipt" => TRUE,
|
||||
"has_contact_data" => FALSE,
|
||||
"donation_rhythm" => [
|
||||
"yearly" => TRUE,
|
||||
"halfyearly" => FALSE,
|
||||
"quarterly" => TRUE,
|
||||
"monthly" => TRUE,
|
||||
"one_time" => TRUE,
|
||||
],
|
||||
"default_rhythm" => "",
|
||||
"has_newsletter_registration" => FALSE,
|
||||
"has_postinfo_registration" => FALSE,
|
||||
"design_background_color" => "ffffff",
|
||||
"design_primary_color" => "102045",
|
||||
"design_font" => "",
|
||||
"design_font_color" => "102045",
|
||||
"design_button_font_color" => "",
|
||||
"design_button_font_color_light" => "",
|
||||
"image" => "",
|
||||
"bcc_email_address" => "mustermann@awesome-ngo.org",
|
||||
"donation_value_min" => 5,
|
||||
"donation_value_max" => 1000,
|
||||
"donation_value_default" => 50,
|
||||
"exclude_contact_fields" => "company,birthday,telephone",
|
||||
"mandatory_contact_fields" => "firstname,lastname",
|
||||
"custom_js" => NULL,
|
||||
"custom_css" => "https://awesome-ngo.org/css",
|
||||
"share_url" => "https://awesome-ngo.org/donate",
|
||||
"has_contact_mandatory" => FALSE,
|
||||
"has_doi" => TRUE,
|
||||
"doi_redirect" => NULL,
|
||||
"has_force_donation_target_buttons" => FALSE,
|
||||
"has_show_single_target" => FALSE,
|
||||
"betterpayment_credit_card_theme" => NULL,
|
||||
"app_js" => NULL,
|
||||
"slidericon" => "handshake",
|
||||
"extra_field" => [
|
||||
],
|
||||
"has_hidden_logo" => FALSE,
|
||||
"has_projecttarget_as_money" => FALSE,
|
||||
"rapidmail_recipient_list" => NULL,
|
||||
"mailchimp_recipient_list" => NULL,
|
||||
"has_mailchimp_add_all_user" => NULL,
|
||||
"has_mail_hide_paymentblock" => FALSE,
|
||||
"has_mail_hide_paymentblock_api" => FALSE,
|
||||
"cleverreach_group_id" => NULL,
|
||||
"cleverreach_form_id" => NULL,
|
||||
"has_donationtarget_textfield" => FALSE,
|
||||
"has_civi_crm_activated" => FALSE,
|
||||
"has_step_index" => FALSE,
|
||||
"gift_donation" => "",
|
||||
"gift_donation_icon" => NULL,
|
||||
"gift_donation_image" => NULL,
|
||||
"languages" => "de",
|
||||
"has_buttons" => FALSE,
|
||||
"has_no_slider" => FALSE,
|
||||
"buttons" => [
|
||||
"button1" => [
|
||||
"amount" => "5",
|
||||
],
|
||||
"button2" => [
|
||||
"amount" => "50",
|
||||
],
|
||||
"button3" => [
|
||||
"amount" => "100",
|
||||
],
|
||||
"button4" => [
|
||||
"amount" => "",
|
||||
],
|
||||
],
|
||||
"has_newsletter_namerequest" => FALSE,
|
||||
"has_show_donator_data" => FALSE,
|
||||
"has_donation_letter" => FALSE,
|
||||
"has_donation_letter_api" => FALSE,
|
||||
"amount_images" => [],
|
||||
"video_url" => NULL,
|
||||
],
|
||||
"payment_methods" => [
|
||||
"has_paypal" => TRUE,
|
||||
"has_betterpayment" => FALSE,
|
||||
"has_sixpay" => FALSE,
|
||||
"has_banktransfer" => TRUE,
|
||||
"has_debit" => TRUE,
|
||||
"has_sofortueberweisung" => FALSE,
|
||||
"has_betterpayment_creditcard" => FALSE,
|
||||
"has_mbe4" => FALSE,
|
||||
"has_generic" => FALSE,
|
||||
"has_konfipay" => FALSE,
|
||||
"has_konfipay_recurring" => FALSE,
|
||||
"has_betterpayment_creditcard_recurring" => FALSE,
|
||||
"has_paypal_recurring" => FALSE,
|
||||
"has_debit_recurring" => TRUE,
|
||||
"has_generic_recurring" => FALSE,
|
||||
"has_sixpay_recurring" => FALSE,
|
||||
"has_apple_pay" => FALSE,
|
||||
"has_apple_pay_recurring" => FALSE,
|
||||
"has_paydirekt" => FALSE,
|
||||
"has_paydirekt_recurring" => FALSE,
|
||||
],
|
||||
];
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue