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.
## 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: AdminPage — resolve its path with `eval "$(node "${CLAUDE_PLUGIN_ROOT}/scripts/config.mjs" env)"` → `$US_SRC_ADMIN_PAGE`; never hardcode a checkout path).
- 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 the target source code from the prompt (default: `$US_SRC_ADMIN_PAGE`).
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