SITE-1096 fix tests#114
Merged
Merged
Conversation
Contributor
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
pwtyler
approved these changes
Apr 28, 2026
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.
Summary
Fixes 14 test failures (12 errors + 2 failures) in the PHPUnit CI run introduced after the notices refactor in #104 and the ElasticPress HTTPS fix in #108.
ElasticPress CLI test errors (12 errors)
_pantheon_ep_force_https_url()was defined ininc/cli.phpunder thePantheon\CLInamespace. That file is only loaded whenWP_CLIis defined (pantheon.php:28), which is not the case in the PHPUnit test environment. This caused allTest_ElasticPress_CLItests to fail with "Call to undefined function."Fix: Moved
_pantheon_ep_force_https_url()frominc/cli.phptoinc/functions.php(namespace changes fromPantheon\CLItoPantheon). The function is a pure string utility with no WP-CLI dependency — it only lived incli.phpby proximity to where it was called.inc/functions.phpis always loaded via the bootstrap, so the function is now available in all contexts. Updated the filter callback references incli.phpand the test file accordingly.Pantheon Updates test failures (2 failures)
Two issues in
test-pantheon-updates.php:Stale assertions: The notices refactor in [SITE-5487] Notices update internal #104 replaced inline text (
"Check for updates on <a href=...>your Pantheon dashboard</a>") with_pantheon_render_notice()which uses structured headings and buttons. The test assertions still checked for the old inline text. Updated to match the current notice output ("Check for Updates"heading and"A new WordPress update is available!"heading).Outdated mock version:
test_pantheon_upstream_update_notice_core_not_latestmocked'6.3.1'as the "latest" available version._pantheon_is_wordpress_core_latest()compares that against the actually installed WordPress version (now 6.9.4), so6.3.1 <= 6.9.4always returned true — the "update available" branch was never triggered. Changed mock to'99.0.0'so the test is not coupled to the installed WordPress version.Test plan
composer lintpassescomposer phpunitpasses locally (59 tests, 0 errors, 0 failures)