chore: Add unit tests for MediaSharing and REST modules - Phase 3#137
Open
sabbir1991 wants to merge 3 commits into
Open
chore: Add unit tests for MediaSharing and REST modules - Phase 3#137sabbir1991 wants to merge 3 commits into
sabbir1991 wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## chore/php-unit-testing-phase-2 #137 +/- ##
=====================================================================
+ Coverage 17.97% 39.41% +21.43%
Complexity 666 666
=====================================================================
Files 22 22
Lines 2748 2748
=====================================================================
+ Hits 494 1083 +589
+ Misses 2254 1665 -589
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds unit test coverage for the OneMedia MediaSharing and REST modules.
Why
This PR improves PHPUnit coverage for recently added MediaSharing and REST functionality, focusing on safe unit-testable paths and keeping the same test style used in the previous unit testing phases.
Related Issue(s):
How
This PR adds and expands PHPUnit tests for:
The tests avoid remote sync, upload, and AJAX exit-heavy success paths, and use WordPress test helpers/factories where possible.
Testing Instructions
Check out this branch.
Start the test environment with coverage enabled:
Run the PHP test suite:
Start the default wp-env environment if needed for linting:
Run PHP linting:
Expected result:
Screenshots
N/A. This PR only adds automated test coverage.
Additional Info
Last verified locally:
npm run test:php153 tests, 257 assertionsnpm run lint:php50 / 50 (100%)chore/php-unit-testing-phase-2this branch so I set this PR base branch tochore/php-unit-testing-phase-2.once this PR chore: Add unit tests for media and settings modules - phase 2 #130 merged we need to reabse the main branch with current PR branchChecklist
npm run changeset.