# wp-self-test: commands

Read from wp-self-test at v2.2.5.

## wp mmwp self-test

Run a plugin's self-test cases, or another self-test action.

```
wp mmwp self-test <slug> [--format=<f>]  # run + validate one plugin's cases; exits 1 on failure.
wp mmwp self-test  # run every registered case.
wp mmwp self-test list [<slug>]  # cases from every registered manifest.
wp mmwp self-test preview [<slug>]  # the steps each case would run.
wp mmwp self-test run [<slug>] [--cleanup]  # same as the bare form.
wp mmwp self-test cleanup [--cases=<ids>]  # remove test data left by earlier runs.
wp mmwp self-test report [--format=<f>]  # the last stored report.
```

| Argument | Description |
| --- | --- |
| [<slug>] | Plugin slug whose cases to run, or one of: list, preview, run, cleanup, report. Default: run every case. |
| [<plugin>] | Plugin slug for the list, preview and run actions. |
| [--cases=<ids>] | Comma-separated case ids. Default: all. |
| [--plugin=<slug>] | Only the cases registered by this plugin. |
| [--layer=<layer>] | Only the cases declaring this layer (rest, cli, ability, core, browser). `browser` runs only the Playwright checks. |
| [--cleanup] | Remove the test data right after each case (what pre-push and CI use). |
| [--format=<format>] | Output format (table, json, csv for list). Default table. |

```
wp mmwp self-test my-plugin --format=table
wp mmwp self-test run --cleanup
wp mmwp self-test list my-plugin
```

Source: https://github.com/mammothwp/wp-self-test/blob/v2.2.5/src/Surfaces/Cli.php#L54
