MCPInstall

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
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads test automatically when relevant.

  3. 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

View all →

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.

OfficialBackend & APIs97 installs

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.

OfficialCode Quality & Workflow86 installs

pr

automattic/wordpress-activitypub

Open the skill to read its SKILL.md instructions.

OfficialCode Quality & Workflow82 installs

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.

OfficialTesting & QA81 installs

federation

automattic/wordpress-activitypub

Open the skill to read its SKILL.md instructions.

Official79 installs

release

automattic/wordpress-activitypub

Open the skill to read its SKILL.md instructions.

Official79 installs

Popular testing & qa skills

View category →

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.

Testing & QA1.2M installs

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.

Testing & QA996.2K installs

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.

Testing & QA484.1K installs

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.

Testing & QA337.8K installs

test-driven-development

obra/superpowers

Use when implementing any feature or bugfix, before writing implementation code

Testing & QA261.8K installs

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

Testing & QA216.8K installs