Skip to content

Tests/connectors: Rename remaining connectors test classes to end with Test - #16527

Open
shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:tests/65208-connectors-rename
Open

shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:tests/65208-connectors-rename

Conversation

@shail-mehta

Copy link
Copy Markdown
Member

What

Trac Ticket: #65208

Renames the 6 remaining connectors/ test files and classes to match the naming already landed in this directory:

  • wpConnectorRegistry.php / Tests_Connectors_WpConnectorRegistry → Connectors_WpConnectorRegistry_Test.php / Connectors_WpConnectorRegistry_Test
  • wpConnectorsGetConnectorScriptModuleData.php / Tests_Connectors_WpConnectorsGetConnectorScriptModuleData → Connectors_WpConnectorsGetConnectorScriptModuleData_Test.php / Connectors_WpConnectorsGetConnectorScriptModuleData_Test
  • wpConnectorsRestSettingsDispatch.php / Tests_Connectors_WpConnectorsRestSettingsDispatch → Connectors_WpConnectorsRestSettingsDispatch_Test.php / Connectors_WpConnectorsRestSettingsDispatch_Test
  • wpConnectorsSanitizeApplicationPasswordCredentials.php / Tests_Connectors_WpConnectorsSanitizeApplicationPasswordCredentials → Connectors_WpConnectorsSanitizeApplicationPasswordCredentials_Test.php / Connectors_WpConnectorsSanitizeApplicationPasswordCredentials_Test
  • wpConnectorsGetConnectorSettings.php / Tests_Connectors_WpGetConnectors → Connectors_WpGetConnectors_Test.php / Connectors_WpGetConnectors_Test
  • wpRegisterConnector.php / Tests_Connectors_WpRegisterConnector → Connectors_WpRegisterConnector_Test.php / Connectors_WpRegisterConnector_Test

Why

Filename and class name align with the unit under test and end with _Test, consistent with the already-renamed connectors tests (e.g. Connectors_WpConnectorsGetApiKeySource_Test). This request follows the one-unit naming guidance and keeps the split separate from this rename. No test behavior changes.

How

  • Used git mv to preserve history
  • Renamed only the files and classes
  • Left existing @covers annotations, groups, fixtures, and tests unchanged

Testing instructions

  1. Run:
npm run test:php -- --test-suffix .php tests/phpunit/tests/connectors
  1. Optionally run multisite:
npm run test:php -- --test-suffix .php -c tests/phpunit/multisite.xml tests/phpunit/tests/connectors
  1. Confirm PHPUnit still discovers and runs the same cases as before the rename. The before-and-after PHPUnit runs matched on both single-site and multisite. This request follows the one-unit naming guidance and keeps the split separate from this rename.

Use of AI Tools

  • Assisted by Cursor

Props for Trac #65208 — align remaining connectors tests with one-unit naming.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No actionable issues were found in the reviewed changes.

No open issues 🎉

What changed in this PR

Standardizes the six remaining connector test filenames and classes to the existing _Test naming convention, supporting ticket #65208.

Changes:

  • Renames files and classes to matching Connectors_*_Test names.
  • Leaves test methods, fixtures, groups, and coverage annotations unchanged.
File Description
tests/​phpunit/​tests/​connectors/​Connectors_WpRegisterConnector_Test.php Renames connector registration tests.
tests/​phpunit/​tests/​connectors/​Connectors_WpGetConnectors_Test.php Renames connector listing tests.
tests/​phpunit/​tests/​connectors/​Connectors_WpConnectorsSanitizeApplicationPasswordCredentials_Test.php Renames credential sanitization tests.
tests/​phpunit/​tests/​connectors/​Connectors_WpConnectorsRestSettingsDispatch_Test.php Renames REST settings dispatch tests.
tests/​phpunit/​tests/​connectors/​Connectors_WpConnectorsGetConnectorScriptModuleData_Test.php Renames script module data tests.
tests/​phpunit/​tests/​connectors/​Connectors_WpConnectorRegistry_Test.php Renames connector registry tests.

Review effort: Balanced

@shail-mehta
shail-mehta marked this pull request as ready for review December 4, 2026 16:53
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props shailu25.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@lancewillett lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 6 renamed files match their class names. I compared the affected tests before and after the rename. All 93 cases in each mode kept their assertion counts and outcomes.

AI review · gpt-6

@lancewillett lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed the target of the last rename in my approval. Could you name that file and class Connectors_RegistrationCompanionFunctions_Test? Core has no wp_register_connector() function. The five tests exercise wp_is_connector_registered(), wp_get_connector(), and wp_get_connectors(). The other five file names look good.

AI review · gpt-6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants