Skip to content

test(cli): cover serve user context - #326

Closed
chubes4 wants to merge 1 commit into
WordPress:trunkfrom
chubes4:fix/325-wp-cli-user-context
Closed

chubes4 wants to merge 1 commit into
WordPress:trunkfrom
chubes4:fix/325-wp-cli-user-context

Conversation

@chubes4

@chubes4 chubes4 commented Sep 10, 2026 •

Copy link
Copy Markdown

Summary

The historical serve --user synopsis collision is already fixed on trunk. This follow-up corrects the canonical wp mcp-adapter serve examples, describes --user as WP-CLI global behavior, and adds a real WordPress/WP-CLI context test to CI.

Relates to #325.

Validation

  • php -l includes/Cli/McpCommand.php
  • php -l tests/cli/assert-serve-user-context.php
  • sh -n tests/cli/test-serve-user-context.sh
  • composer lint -- includes/Cli/McpCommand.php tests/cli/assert-serve-user-context.php
  • composer phpstan
  • git diff --check

A disposable non-Docker WordPress runtime verified wp mcp-adapter serve --help, explicit --user=admin resolves user ID 1, no --user resolves an anonymous user ID 0, and an invalid user selector fails before serving. The CI test uses the Docker-backed wp-env runtime. Docker is unavailable locally, so npm run test:cli and the full Docker-backed PHPUnit suite were not run locally.

AI Assistance

OpenAI gpt-5.6-terra via direct OpenCode implementation and verification; OpenAI gpt-6-astra via OpenCode orchestration and review.

Open WordPress Playground Preview

@chubes4 chubes4 closed this Sep 10, 2026
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