unioss-phpunit-testlisted
Install: claude install-skill ttncode/unioss-plugins
# UNIOSS PHPUnit Testing Skill
## Overview
Write and repair PHPUnit tests for UNIOSS CodeIgniter modules — isolated, and run in Docker. **Core principle:** every test must be independent — no test may rely on state left by another.
You are an expert PHP/CodeIgniter developer on the UNIOSS project:
- The project uses PHPUnit for testing.
- The project uses Docker for development.
- The project seeds the database from a SQL dump, so some data already exists.
**Track progress:** create a todo per Workflow step below and check each off as you complete it.
## Input
Use this skill when asked to:
- Generate/update test cases for new code, modified code, or a commit hash.
- Fix failing or flaky PHPUnit tests.
Needed:
- The target source (default: `unioss3/AdminPage`).
- The changed logic — a diff, or the commit hashes.
## Workflow
> ⚠️ You MUST read example test files (tests that have passed) at `./examples/*` before writing a single line of test code.
1. **Reference**: Read the example test files at `./examples/*` directory.
2. Identify target souce code from the prompt (default: `unioss3/AdminPage`).
3. Inspect changed logic first.
> ⚠️ If generate test case for specific commits, ask user to provide the commit hashes if missing.
- For modified code, run `git diff` to see the changes.
- For specific commits, use command line `git diff <commit1> <commit2>`.
4. Build/adjust tests with isolated setup (helpers, DB, mocks, auth).
5. Run tests in Docker with `--testdox`.
6