Skip to content

Add practical PHP testing guidance to AGENTS.md#47618

Open
kraftbj wants to merge 1 commit intotrunkfrom
connection-test-docs
Open

Add practical PHP testing guidance to AGENTS.md#47618
kraftbj wants to merge 1 commit intotrunkfrom
connection-test-docs

Conversation

@kraftbj
Copy link
Contributor

@kraftbj kraftbj commented Mar 16, 2026

Fixes #

Proposed changes

While working on the packages/connection package, an AI coding agent couldn't figure out how to run the package's PHP tests. It guessed commands like jp phpunit (which doesn't exist) and failed to discover the correct jp test php invocation with its flags. The existing AGENTS.md Testing section listed the basic commands but lacked the practical details agents need to actually run and write tests.

This expands the PHP Testing section with:

  • Clarification that jp test php works for all projects except plugins/jetpack (which uses jp docker commands)
  • --verbose and --filter flag usage with concrete examples
  • WorDBless testing pattern: extend WorDBless\BaseTestCase, use wp_insert_user() + get_userdata() instead of self::factory()->user->create_and_get() (which is not available in WorDBless)
  • Reference to an existing test example in projects/packages/connection/tests/php/sso/Helpers_Test.php

Other information

  • Generate changelog entries for this PR (using AI).

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • Review the diff to AGENTS.md for accuracy and completeness.
  • No functional code changes — documentation only.

Expand the PHP Testing section with details that AI agents need
to correctly run and write tests: verbose/filter flags, WorDBless
patterns, and the jp test vs jp docker distinction for plugins/jetpack.
@kraftbj kraftbj added the [Status] Needs Review This PR is ready for review. label Mar 16, 2026
@kraftbj kraftbj self-assigned this Mar 16, 2026
@github-actions github-actions bot added the Docs label Mar 16, 2026
@github-actions
Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@kraftbj kraftbj requested a review from a team March 16, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant