DEV: Refactor xmlrpc_publish_post_to_discourse #491
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempts to improve the
xmlrpc_publish_post_to_discourse
method. That method exists for historical reasons. I'm reluctant to remove it entirely, but I suspect that it's not being used on any sites.This PR also:
publish_post_after_save
toupdate_post_meta( $post_id, 'publish_post_category', intval( $this->options['publish-category'] ) );
for force published posts. That is already being handled in thesync_to_discourse_work
method.sanitize_title( $title )
frompublish_post_after_save
to thesync_to_discourse_work
methodpublish_failure_notification
to allow that method to be easily tested$this->email_notifier = \Mockery::mock( EmailNotification::class )->makePartial();
)self::$plugin_options
for subsequent tests (there are still tests in this class that have that issue. I can update them.)Todo:
email_notifier
property