stream
stream copied to clipboard
GravityForms connector test implemented
Partially fixes #1093
Summary checklist
- [x]
gform_after_save_formcallback test implemented and passing. - [x]
gform_delete_leadcallback test implemented and passing. - [x]
gform_pre_confirmation_savecallback test implemented and passing. - [x]
gform_pre_notification_savecallback test implemented and passing. - [x]
gform_pre_notification_deletedcallback test implemented and passing. - [x]
gform_pre_confirmation_deletedcallback test implemented and passing. - [x]
gform_confirmation_statuscallback test implemented and passing. - [x]
gform_notification_statuscallback test implemented and passing. - [x]
checkfunction test implemented and passing. - [x]
gform_post_note_addedcallback test implemented and passing. - [x]
gform_pre_note_deletedcallback test implemented and passing. - [x]
gform_update_statuscallback test implemented and passing. - [x]
gform_update_is_readcallback test implemented and passing. - [x]
gform_update_is_starredcallback test implemented and passing. - [x]
log_form_actionfunction test implemented and passing. - [x]
gform_post_export_entriescallback test implemented and passing. - [x]
gform_forms_post_importcallback test implemented and passing. - [x]
gform_export_separatorcallback refactored. It's now thegform_export_formcallback and has been tested. - No test was written for the
gform_export_optionscallback. Further inspection is needed to determine it's relevance.
@kasparsd I'm not sure about leaving the plugin out, since the tests relies on it.
@kidunot89 and @kasparsd In order to add the plugin it would need to be done in a way that is progressive and legal. It should not fail a build if the plugin is missing, so tests should only run if installed and active, and while we can install it with Composer I'm not sure if we can gracefully fail.
At any rate the minimum changes are that we need to add this object to the repositories array.
{
"type": "package",
"package": {
"name": "gravityforms/gravityforms",
"version": "2.4.21.3",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
"url": "https://www.gravityhelp.com/wp-content/plugins/gravitymanager/api.php?op=get_plugin&slug=gravityforms&key={%GRAVITYFORMS_KEY}"
},
"require": {
"composer/installers": "^1.4",
"gotoandplay/gravityforms-composer-installer": "^2.3"
}
}
}
Also, we will need to add "gravityforms/gravityforms": "2.4.21.3" to require-dev and find a way to fail gracefully if the environment variable for the key it either missing or invalid. Locally you would also need to create a .env file and add GRAVITYFORMS_KEY=YOUR_SECRET_KEY and for the build to pass we can add the elite key we use for XWP projects to Travis CI.
There are really only two hurdles:
- Make tests run with/without plugin
- Degrade gracefully in Composer
@kasparsd @ivankruchkoff The GravityForms package has been updated as @derekherman suggested, and I've added the GRAVITYFORMS_KEY as a secret in Travis-CI. If either of your reviews approve this should finally be all ready for merging.