Test

Write PHPUnit tests for PHP source files, auto-detecting conventions from the project.

wp-media a450d06 1010 B Updated

File contents

Test Writer

Writes PHPUnit unit and integration tests for PHP source files in this project.

Conventions (naming, @group annotations, mocking libraries) are discovered from the architecture skill and existing test files — not assumed. Works for any WordPress plugin with Cadenza.

Project identity

Project identity is auto-detected (see AGENTS.md §3) — no config file. This skill uses: {ARCH_SKILL}, {DISPLAY_NAME}.

Steps

  1. Parse the argument (if any):

    • No argument → target = "auto" (find changed source files on the current branch that lack test coverage)
    • src/Foo/Bar.phptarget = "src/Foo/Bar.php"
    • Multiple files → target = ["src/Foo/Bar.php", "src/Baz/Qux.php"]
  2. Spawn test-writer as a sub-agent, passing target and the project config above.

  3. Return the list of test files written and the command to run them.

wp-media/cadenza/tree/main/skills/test commit a450d0609a

Frequently asked questions

npx skillmds@latest add wp-media/test