Repository navigation
Tests: Add unit test coverage for Admin\Deactivation routine - #1022
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
dkotter
left a comment
There was a problem hiding this comment.
There are some test failures here that need cleaned up before proceeding
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1022 +/- ##
=============================================
+ Coverage 81.51% 81.67% +0.16%
Complexity 2924 2924
=============================================
Files 122 122
Lines 11655 11655
=============================================
+ Hits 9500 9519 +19
+ Misses 2155 2136 -19
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:
|
Hi @dkotter, I've fixed the connector schema issue in |
What?
Closes #1021
Adds unit test coverage for the
Admin\Deactivationroutine intests/Integration/Includes/Admin/DeactivationTest.php.Why?
Currently, the plugin provides integration test coverage for the activation routine in
tests/Integration/Includes/Admin/ActivationTest.php, butincludes/Admin/Deactivation.phplacked dedicated unit/integration test coverage. Adding this test suite ensures that deactivation logic is verified and protected against regressions (such as properly decrypting and restoring keys when Key Encryption is enabled, and remaining a no-op when disabled).How?
tests/Integration/Includes/Admin/DeactivationTest.phpwith the following test cases:test_deactivation_callback_with_experiment_disabled_is_noop(): Verifies thatdeactivation_callback()is a safe no-op when Key Encryption is not effectively enabled.test_deactivation_callback_restores_plaintext_when_enabled(): Verifies thatdeactivation_callback()restores plaintext API keys towp_optionsand cleans up encrypted secrets when Key Encryption is active.Use of AI Tools
AI assistance: Yes
Model(s): Gemini 3.8 Flash High
Used for: Identifying missing test coverage for
Deactivation.php, structuring the test class, and reviewing against existing test patterns inActivationTest.phpandKey_EncryptionTest.php. Final implementation was reviewed, tested, and verified by me.Testing Instructions
npm run typecheck && npm run lint:jstests/Integration/Includes/Admin/DeactivationTest.phppasses cleanly.Changelog Entry