Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/microck-activitypub-testing/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -19% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 17% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -3% | 0% |
This skill provides guidance on writing and running tests for the WordPress ActivityPub plugin.
For complete testing commands and environment setup, see Testing Reference.
npm run env-testnpm run test:e2enpm run test:unitphp<?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 } }
For transformer and handler testing patterns, see Testing Reference - Writing Effective Tests.
For mocking HTTP requests and other utilities, see Testing Reference - Test Utilities.
Use @group annotations:
php/** * @group activitypub * @group federation */ public function test_federation_feature() { // Test code }
javascriptconst { 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'); });
javascripttest('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'); });
For creating test data (users, posts, comments), see Testing Reference - Test Utilities.
See Testing Reference for detailed coverage generation instructions.
php// In tests var_dump( $data ); error_log( print_r( $result, true ) ); // Run with verbose npm run env-test -- --verbose --debug
bash# Run single test method npm run env-test -- --filter=test_specific_method # Stop on first failure npm run env-test -- --stop-on-failure
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,205 | 7,425 | -44% | 1 | 1 | 0% | 2,344 | 1,892 | -19% | 0 | 0 | — |
case-02 | fail→pass | 10,467 | 4,094 | -61% | 1 | 1 | 0% | 1,345 | 1,351 | +0% | 0 | 0 | — |
case-03 | fail→pass | 5,843 | 3,253 | -44% | 1 | 1 | 0% | 976 | 1,146 | +17% | 0 | 0 | — |
case-04 | fail→pass | 7,544 | 2,692 | -64% | 1 | 1 | 0% | 1,205 | 1,116 | -7% | 0 | 0 | — |
case-17 | pass→pass | 6,753 | 2,009 | -70% | 1 | 1 | 0% | 1,177 | 986 | -16% | 0 | 0 | — |
case-05 | pass→pass | 8,682 | 3,481 | -60% | 1 | 1 | 0% | 1,380 | 1,128 | -18% | 0 | 0 | — |
case-06 | fail→pass | 10,418 | 5,371 | -48% | 1 | 1 | 0% | 1,617 | 1,564 | -3% | 0 | 0 | — |
case-07 | pass→pass | 10,480 | 4,352 | -58% | 1 | 1 | 0% | 1,943 | 1,461 | -25% | 0 | 0 | — |
case-08 | fail→pass | 6,034 | 5,301 | -12% | 1 | 1 | 0% | 956 | 1,682 | +76% | 0 | 0 | — |
case-09 | pass→pass | 6,212 | 3,039 | -51% | 1 | 1 | 0% | 1,094 | 1,037 | -5% | 0 | 0 | — |
case-10 | fail→pass | 6,463 | 5,475 | -15% | 1 | 1 | 0% | 1,073 | 1,493 | +39% | 0 | 0 | — |
case-11 | pass→pass | 8,021 | 3,540 | -56% | 1 | 1 | 0% | 1,209 | 1,209 | 0% | 0 | 0 | — |
case-12 | pass→pass | 9,889 | 5,633 | -43% | 1 | 1 | 0% | 1,678 | 1,588 | -5% | 0 | 0 | — |
case-13 | pass→pass | 10,106 | 4,508 | -55% | 1 | 1 | 0% | 1,650 | 1,510 | -8% | 0 | 0 | — |
case-14 | pass→pass | 8,675 | 2,972 | -66% | 1 | 1 | 0% | 658 | 1,176 | +79% | 0 | 0 | — |
case-15 | pass→pass | 6,693 | 2,350 | -65% | 1 | 1 | 0% | 1,087 | 996 | -8% | 0 | 0 | — |
case-16 | fail→pass | 14,886 | 4,996 | -66% | 1 | 1 | 0% | 1,721 | 1,659 | -4% | 0 | 0 | — |
case-18 | pass→pass | 8,883 | 3,968 | -55% | 1 | 1 | 0% | 1,412 | 1,320 | -7% | 0 | 0 | — |
case-19 | pass→pass | 6,637 | 2,951 | -56% | 1 | 1 | 0% | 1,110 | 1,110 | 0% | 0 | 0 | — |
case-20 | pass→pass | 10,776 | 9,496 | -12% | 1 | 1 | 0% | 2,025 | 2,573 | +27% | 0 | 0 | — |
case-21 | pass→pass | 11,395 | 7,253 | -36% | 1 | 1 | 0% | 2,124 | 1,999 | -6% | 0 | 0 | — |
case-22 | pass→pass | 9,634 | 4,383 | -55% | 1 | 1 | 0% | 1,888 | 1,410 | -25% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +36 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.