Skip to content

Port r65272: tidy the Secrets API tests and inline documentation - #19

Merged
ericmann merged 1 commit into
mainfrom
core-r65272
Nov 9, 2026
Merged

ericmann merged 1 commit into
mainfrom
core-r65272

Conversation

@ericmann

@ericmann ericmann commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Ports r65272 from core trunk (#66187). It tidies the Secrets API tests and inline documentation:

  • Tests follow core's PHPUnit guidelines. Each test has a summary, @covers and a failure message for every assertion, and each class has @ticket 66187. The conformance suites put @covers on the concrete classes. Multisite-only tests use the ms-required group.
  • New tests cover a store that cannot list its secrets, the pinned WP_SECRETS_ERROR_* values, and a valid but different WP_SECRETS_KEY.
  • In src/, the docblocks no longer refer to the feature plugin, its proposal or its decision records, and neither does the _doing_it_wrong() notice for unnamespaced names. The drop-in globals get @global annotations.

With this, src/ and the shared test helpers match trunk byte for byte again.

Beyond the straight port:

  • wp_secrets_api_load_dropin() gets the same @global annotations that r65272 added to core's wp_load_secrets_dropin().
  • The ported test files differ from core only where they name the plugin's drop-in loader, plus one blank line in test-wp-secrets-memzero.php that the plugin's PHPCS rules require.
  • The plugin-only capabilities test is not a copy of core's, so it is unchanged.
  • docs/reference/ is regenerated.

Testing

Run locally against WordPress 7.1.4:

  • Single site: 505 tests, 31 skipped. Multisite: 505 tests, 20 skipped. main has 506 tests, because r65272 removes duplicated tests and adds new ones.
  • PHPCS, the PHP 7.4 compatibility check and PHPStan level 10 are clean. make reference-check passes.
  • The WP-CLI smoke test passes, 146 of 146.

Props peterwilsoncc.

Ports r65272 from core trunk. It brings the tests in line with core's PHPUnit
guidelines: a summary, @Covers and a failure message for each assertion,
@ticket 66187 on each class, single-use data providers named after their test,
and multisite-only tests in the ms-required group. It also adds tests for a
store that cannot list its secrets, for the pinned WP_SECRETS_ERROR_* values
and for a valid but different WP_SECRETS_KEY. In src/ it removes the references
to the feature plugin, its proposal and its decision records, including in the
_doing_it_wrong() notice for unnamespaced names, and adds @global annotations
for the drop-in globals.

src/ and the shared test helpers match trunk byte for byte again. The ported
test files differ from core only where the plugin's drop-in loader has its own
name, and by one blank line the plugin's PHPCS rules require.
wp_secrets_api_load_dropin() gets the same @global annotations as core's
wp_load_secrets_dropin(). docs/reference/ is regenerated.

https://core.trac.wordpress.org/changeset/65272
https://core.trac.wordpress.org/ticket/66187

Props peterwilsoncc.
@ericmann
ericmann merged commit 5f36869 into main Nov 9, 2026
17 checks passed
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.

1 participant