Add test coverage for get_code_length() and autosubmit filters#821
Conversation
…gth filter Co-authored-by: georgestephanis <941023+georgestephanis@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
get_code_length() and autosubmit filters
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Copilot. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
18732c9
into
alternative/pr-741-autosubmit-tweak
The new
get_code_length()static method,two_factor_code_lengthfilter, andtwo_factor_autosubmit_lengthfilter introduced in #820 had no test coverage.Changes
tests/providers/class-two-factor-provider.phptest_get_code_length_returns_default—get_code_length()returns its$defaultargument when no filter is hookedtest_get_code_length_filter_overrides_default—two_factor_code_lengthfilter overrides the defaulttest_get_code_with_null_uses_filtered_length—get_code(null)delegates toget_code_length(), picking up the filtered valuetests/providers/class-two-factor-backup-codes.phptest_autosubmit_length_filter_affects_authentication_page—two_factor_autosubmit_lengthfilter changes thedata-digitsattribute in the rendered authentication page HTML; also covers the__return_zerodisable-autosubmit use case documented in the readme💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.