Skip to content

Tests: Add enable_real_time_collaboration to REST settings test#1

Merged
chriszarate merged 1 commit intochriszarate:add/collaboration-functionalityfrom
pkevan:pkevan/fix-realtime-test
Feb 17, 2026
Merged

Tests: Add enable_real_time_collaboration to REST settings test#1
chriszarate merged 1 commit intochriszarate:add/collaboration-functionalityfrom
pkevan:pkevan/fix-realtime-test

Conversation

@pkevan
Copy link
Copy Markdown

@pkevan pkevan commented Feb 17, 2026

Summary

  • Adds enable_real_time_collaboration to the expected settings array in WP_Test_REST_Settings_Controller::test_get_items
  • The new setting is registered with show_in_rest but was missing from the test hardcoded expected list, causing test failures across all PHP/DB matrix combinations

Test plan

  • CI passes for WP_Test_REST_Settings_Controller::test_get_items

…ted values

The test_get_items test in WP_Test_REST_Settings_Controller hardcodes
the expected list of settings exposed via the REST API. The new
enable_real_time_collaboration setting was registered with
show_in_rest but not added to this expected list, causing the test
to fail.
@chriszarate
Copy link
Copy Markdown
Owner

Thanks @pkevan!

chriszarate pushed a commit that referenced this pull request Mar 18, 2026
…om `previous_posts()`.

The `esc_url()` function expects to a string for `$url` parameter. There is no input validation within that function. The function contains a `ltrim()` which also expects a string. Passing `null` to this parameter results in `Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1+.

Tracing the stack back, a `null` is being passed to it within `previous_posts()` when `get_previous_posts_page_link()` returns `null` (it can return a string or `null`).

On PHP 7.0 to PHP 8.x, an empty string is returned from `esc_url()` when `null` is passed to it. The change in this changeset avoids the deprecation notice by not invoking `esc_url()` when `get_previous_posts_page_link()` returns `null` and instead sets the `$output` to an empty string, thus maintaining the same behavior as before (minus the deprecation notice).

Adds a test to validate an empty string is returned and the absence of the deprecation (when running on PHP 8.1+).

Follow-up to [9632], [11383], [56740].

Props dd32, alexodiy.
Fixes #64864.

git-svn-id: https://develop.svn.wordpress.org/trunk@62034 602fd350-edb4-49c9-b593-d223f7449a82
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