Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media connector test implemented. #1154

Merged
merged 3 commits into from
Mar 26, 2021
Merged

Media connector test implemented. #1154

merged 3 commits into from
Mar 26, 2021

Conversation

kidunot89
Copy link
Contributor

@kidunot89 kidunot89 commented Aug 5, 2020

Partially fixes #1093
Fixes #907

Summary Checklist

  • add_attachment callback test implemented and passing. Refactored to avoid breaking on invalid parent posts.
  • delete_attachment callback test implemented and passing.
  • edit_attachment callback test implemented and passing.
  • wp_save_image_editor_file callback test implemented and passing.
  • No test created for the wp_save_image_file callback because the hook is deprecated in WordPress and wp_save_image_editor_file is the replacement.

#907 patch implemented here to avoid future merge conflicts if put in separate PR.

@@ -151,7 +151,7 @@ public function callback_add_attachment( $post_id ) {
$url = $post->guid;
$parent_id = $post->post_parent;
$parent = get_post( $parent_id );
$parent_title = $parent_id ? $parent->post_title : null;
$parent_title = $parent instanceof \WP_Post ? $parent->post_title : 'Unidentifiable post';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kasparsd Please take a look at this ☝️. It resolves #907. I also updated the corresponding test to test this logic as well.

@kidunot89 kidunot89 modified the milestones: 3.6.1, 3.7.0 Jan 4, 2021
@kidunot89 kidunot89 mentioned this pull request Feb 22, 2021
7 tasks
@kidunot89 kidunot89 merged commit 75510eb into develop Mar 26, 2021
@kidunot89 kidunot89 deleted the tests/media-connector branch March 26, 2021 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Test Coverage Media connector assumes parent post exists
2 participants