.agents/skills/test/SKILL.md
Testing patterns for PHPUnit tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ATmosphere features.
npx skillsauth add Automattic/wordpress-atmosphere testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
npm run env-testnpm run env-test -- --filter=test_namecomposer test<?php
namespace Atmosphere\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.
}
}
Tests live in tests/phpunit/tests/ with a directory structure mirroring includes/:
tests/phpunit/tests/
├── class-test-functions.php
├── transformer/
│ ├── class-test-tid.php
│ ├── class-test-facet.php
│ └── class-test-publication.php
└── ...
Test files are prefixed with class-test- and the class name is Test_ + feature name.
Use @group annotations:
/**
* @group atmosphere
* @group transformer
*/
public function test_transformer_feature() {
// Test code.
}
All HTTP requests are disabled by default in the bootstrap. To allow specific requests:
add_filter( 'tests_allow_http_request', function( $allow, $args, $url ) {
if ( str_contains( $url, 'expected-domain.com' ) ) {
return true;
}
return $allow;
}, 10, 3 );
# Run with verbose output.
npm run env-test -- --verbose --debug
# Stop on first failure.
npm run env-test -- --stop-on-failure
# Run single test method.
npm run env-test -- --filter=test_specific_method
development
Testing patterns for PHPUnit tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ATmosphere features.
documentation
Version management and release processes using Jetpack Changelogger. Use when creating releases, managing changelogs, bumping versions, or preparing releases.
testing
MUST be invoked before creating any PR, pushing a branch for review, or running `gh pr create`. Covers changelog entries, branch naming, PHPCS/PHPUnit checks, and reviewer assignment.
tools
Development workflows for WordPress ATmosphere plugin including wp-env setup, testing commands, linting, and build processes. Use when setting up development environment, running tests, checking code quality, or working with wp-env.