
test
Testing patterns for PHPUnit and Playwright E2E tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ActivityPub features.
- Installs
- 80
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/automattic/wordpress-activitypub --skill test- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads test automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
ActivityPub Testing
This skill provides guidance on writing and running tests for the WordPress ActivityPub plugin.
Quick Reference
For complete testing commands and environment setup, see Testing Reference.
Key Commands
- PHP:
npm run env-test - E2E:
npm run test:e2e - JavaScript:
npm run test:unit
PHPUnit Testing
Test Structure
<?php
namespace Activitypub\Tests;
use WP_UnitTestCase;
class Test_Feature extends WP_UnitTestCase {
public function set_up(): void {
parent::set_up();
// Setup
}
public function tear_down(): void {
// Cleanup
parent::tear_down();
}
public function test_functionality() {
// Test implementation
}
}
Common Test Patterns
For transformer and handler testing patterns, see Testing Reference - Writing Effective Tests.
For mocking HTTP requests and other utilities, see Testing Reference - Test Utilities.
Test Groups
Use @group annotations:
/**
* @group activitypub
* @group federation
*/
public function test_federation_feature() {
// Test code
}
E2E Testing with Playwright
Basic E2E Test
const { test, expect } = require('@playwright/test');
test('ActivityPub settings page loads', async ({ page }) => {
await page.goto('/wp-admin/options-general.php?page=activitypub');
await expect(page.locator('h1')).toContainText('ActivityPub');
});
Testing Federation
test('WebFinger discovery works', async ({ page }) => {
const response = await page.request.get('/.well-known/webfinger', {
params: {
resource: 'acct:admin@localhost:8888'
}
});
expect(response.ok()).toBeTruthy();
const json = await response.json();
expect(json.subject).toBe('acct:admin@localhost:8888');
});
Test Data Factories
For creating test data (users, posts, comments), see Testing Reference - Test Utilities.
Coverage Reports
See Testing Reference for detailed coverage generation instructions.
Debugging Tests
Debug Output
// In tests
var_dump( $data );
error_log( print_r( $result, true ) );
// Run with verbose
npm run env-test -- --verbose --debug
Isolating Tests
# Run single test method
npm run env-test -- --filter=test_specific_method
# Stop on first failure
npm run env-test -- --stop-on-failure
FAQ
What does the test skill do?
Testing patterns for PHPUnit and Playwright E2E tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ActivityPub features.
How do I install test?
Run npx skills add https://github.com/automattic/wordpress-activitypub --skill test in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/test/ (personal) or .claude/skills/test/ (project).
Which AI agents can use test?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is test safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains test?
It is published by automattic in automattic/wordpress-activitypub, and it is an official skill from the maker of the technology it covers. It has 80 recorded installs.
More from automattic/wordpress-activitypub
code-style
automattic/wordpress-activitypub
PHP coding standards and WordPress patterns for ActivityPub plugin. Use when writing PHP code, creating classes, implementing WordPress hooks, or structuring plugin files.
integrations
automattic/wordpress-activitypub
Third-party WordPress plugin integration patterns. Use when adding new integrations, debugging compatibility with other plugins, or working with existing integrations.
pr
automattic/wordpress-activitypub
Open the skill to read its SKILL.md instructions.
dev
automattic/wordpress-activitypub
Development workflows for WordPress ActivityPub plugin including wp-env setup, testing commands, linting, and build processes. Use when setting up development environment, running tests, checking code quality, building assets, or working with wp-env.
federation
automattic/wordpress-activitypub
Open the skill to read its SKILL.md instructions.
release
automattic/wordpress-activitypub
Open the skill to read its SKILL.md instructions.
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work