Skip to content

Conversation

@martinkrcho
Copy link

The PR introduces a new method WP_UnitTestCase_Base::_upload_file_and_make_attachment() that uploads given file and creates an attachment post from it.

It also replaces all occurrences of the repetitive code - with the exception of few places where extra tests are ran to check the result of wp_upload_bits() call.

Trac ticket: https://core.trac.wordpress.org/ticket/56248


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@hellofromtonya hellofromtonya self-requested a review January 19, 2023 20:47
Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Thanks @martinkrcho, Left some feedbacks.

@martinkrcho martinkrcho force-pushed the fix/56248-file-upload-tests-improvement branch from 476cfe3 to e422c35 Compare January 30, 2023 08:59
@martinkrcho martinkrcho requested review from mukeshpanchal27 and removed request for hellofromtonya January 30, 2023 10:58
@martinkrcho
Copy link
Author

@hellofromtonya I accidentally removed you from the reviewers. Anyway, the code is refactored to use a trait now and ready for another review.

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.

2 participants